Sorry for the small post but this can be useful
So I saw on the forums this post: Is there something like parent to the power of? So I decided to make a function for that!
Here it is:
function getParentOfPower (obj,pow)
local objP = obj
for i = 1,pow do
objP = objP.Parent
end
return objP
end
NOTE: This starts counting from the object. So if you if you wanted to get something parented to the object 3 times then you need to put 3 in the “pow” Argument.
Example usage:
local part = workspace.Part.Part.Part.Part1
print(getParentOfPower(part,3).Name)
--// prints: "Part" since its parented 3 times to the part instance \\--
Hopefully this helps!