uhh still not good.
Small bump but you can do something like:
for _, directory in pairs(addressStrings) do
print(directory)
end
Just prints each thing inside the “addressStrings” table
Obj:IsAncestorOf(AncestorPart)
That doesn’t answer the OP’s question; it just returns a boolean on whether or not an Instance is an Ancestor of another Instance. The OP is asking how to fetch all of the Ancestors of an Instance
You can use Obj:GetFullName() which returns the EXACT path of something. Then based on that, you can run a for loop to find if it is a descendant of something.
–When current == game, stop the code
I believe your function is meant to look like this
function getPath(instance)
local path = instance.Name
local current = instance.Parent
while current do
path = current.Name … “.” … path
current = current.Parent
end
return path
end
Correction: ipairs. I’ll try this whenever i can.
Hmm. I’m gonna look more into it. Never knew this method existed.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.