IsDescendantOf (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>SoulStealer9875
No edit summary
>SoulStealer9875
No edit summary
(No difference)

Revision as of 19:46, 5 September 2011

IsDescendantOf( Instance ancestor )
Returns boolean is descendant
Description: Returns true if the object is an descendant of ancestor, otherwise false.
Member of: Instance

Description

Tells whether one of the Parents of the Parents of etc.. of the calling object is the argument.

Example
a = Instance.new("Part") --> put a part in workspace
a.Parent = game.Workspace

print(a:IsDescendantOf(game)) --> prints true
function CheckDescendant(Obj, Desc)
    return Obj:IsDescendantOf(Desc)
end