IsDescendantOf (Function): Difference between revisions

From Goodblox Wiki
Jump to navigationJump to search
mNo edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{CatUp|Functions}}
{{CatUp|Functions}}
<onlyinclude>{{Function|
<onlyinclude>{{Function|
name                  = IsDescendantOf
name                  = IsDescendantOf
Line 14: Line 13:
==Example==
==Example==
<pre>
<pre>
a = Instance.new("Part") --> put a part in workspace
local a = Instance.new("Part") --> put a part in workspace
a.Parent = game.Workspace
a.Parent = workspace


print(a:IsDescendantOf(game)) --> prints true
print(a:IsDescendantOf(game)) --> prints true

Latest revision as of 20:50, 23 September 2021

Function
Syntax IsDescendantOf( Instance ancestor )
Returns Boolean is descendant
Description: Returns True if the object is an descendant of ancestor
In Object: Global


Description

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

Example

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

print(a:IsDescendantOf(game)) --> prints true