2023-05-20 18:49:37 +01:00
|
|
|
local roblox = require("@lune/roblox")
|
2023-03-25 16:26:16 +00:00
|
|
|
local Instance = roblox.Instance
|
|
|
|
|
|
|
|
local root = Instance.new("Folder")
|
|
|
|
local child = Instance.new("Model")
|
|
|
|
local descendant = Instance.new("Part")
|
|
|
|
|
|
|
|
child.Parent = root
|
|
|
|
descendant.Parent = child
|
|
|
|
|
|
|
|
assert(not root:IsAncestorOf(root))
|
|
|
|
assert(not child:IsAncestorOf(root))
|
|
|
|
assert(not descendant:IsAncestorOf(root))
|
|
|
|
|
|
|
|
assert(root:IsAncestorOf(child))
|
|
|
|
assert(not child:IsAncestorOf(child))
|
|
|
|
assert(not descendant:IsAncestorOf(child))
|
|
|
|
|
|
|
|
assert(root:IsAncestorOf(descendant))
|
|
|
|
assert(child:IsAncestorOf(descendant))
|
|
|
|
assert(not descendant:IsAncestorOf(descendant))
|