DiagnosticsOverviewNew · 0.744
getscriptparentmodule
Describe a script's enclosing module relationship.
Details#
Walks up to 64 Parent links and returns the first ModuleScript ancestor, or nil. The script itself is not tested as its own ancestor.
Examples#
Example
local parent = Instance.new("ModuleScript")
local child = Instance.new("LocalScript")
child.Parent = parent
print(getscriptparentmodule(child) == parent) -- true
parent:Destroy()