Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to tell if an part is a parent of another part?

I've been trying to get a script to tell if an object is a parent of an model, but I've been having a bit of trouble with it. Can anyone help me out?

I've tried something like this already.

If game.Workspace.Model.Part.Parent == nil then ...etc

1 answer

✓ Accepted answer

What you're trying to do can be achieved the same way by checking if the part is a child of the model. Here is how you can check if the part is a child of the model,

if not game.Workspace:WaitForChild("Model"):FindFirstChild("Part") then
    print("Part's parent is not Model")
else
    print("Part's parent is model")
end

If I'm being honest I don't think this is the answer to your question. I have no clue what you're trying to do. The point is I tried. Good luck.

2 comments

0

Exactly what I was looking for, thanks.

0

Oh lol. Thanks.

This discussion is preserved as it was. New answers, comments, and votes are closed.