Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
4xN 10
8 years ago

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

Log in to vote
1
Answered by 8 years ago

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.

0
Exactly what I was looking for, thanks. 4xN 10 — 8y
0
Oh lol. Thanks. User#11440 120 — 8y
Ad

Answer this question