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

Script.Parent Method is glitching?

Asked by 9 years ago

Everytime I use the Parent method, for example torso = script.Parent:findFirstChild("Torso") the script will ouput in red torso is not a valid member of "hat1"... Anyone know what the problem is or why its doing ? And yes, The script isn't in any descendant of the player its inside of the player and player is its parent. So it should locate torso.?

1 answer

Log in to vote
0
Answered by
RSoMKC 45
9 years ago

You've got to add an extra .Parent

Your script is currently looking for "Torso" inside the parent of the script. AKA, the "hat1"

script.Parent.Parent:findFirstChild("Torso")
Ad

Answer this question