mirror of
https://github.com/lune-org/lune.git
synced 2024-12-14 22:51:05 +00:00
16 lines
549 B
Lua
16 lines
549 B
Lua
local roblox = require("@lune/roblox") :: any
|
|
local Instance = roblox.Instance
|
|
|
|
local root = Instance.new("Folder")
|
|
local child = Instance.new("Model")
|
|
local nested = Instance.new("Tool")
|
|
local descendant = Instance.new("Part")
|
|
|
|
descendant.Parent = nested
|
|
nested.Parent = child
|
|
child.Parent = root
|
|
|
|
assert(descendant:FindFirstAncestorWhichIsA("Part") == nil)
|
|
assert(descendant:FindFirstAncestorWhichIsA("Tool") == nested)
|
|
assert(descendant:FindFirstAncestorWhichIsA("Model") == nested)
|
|
assert(descendant:FindFirstAncestorWhichIsA("Folder") == root)
|