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

torso is not a valid member of Model??

Asked by 8 years ago

I'm trying to add a script I made quite some time ago into the starterpack so that people spawn and the script loads. It is a grapple hook script, and I honestly have no idea why it isn't working. The top of the script is this:

plr = script.Parent.Parent
Char = plr.Character
mouse = plr:GetMouse()
tor = Char.Torso
larm = Char['Left Arm']
rarm = Char['Right Arm']
swagyolo = false

So when I test it's fine, but when I publish and play the game it comes up with "Torso is not a valid member of Model" plez help?

0
I fixed it, it was because I did not use WaitForChild. The script ran before my torso was created, causing it to error. CubicleCurse 5 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

It can't just be player, it has to be localplayer so it pertains to anyone, not just the one in studio. (i think im not rlly a wizz)

0
That's what I did beforehand, either way it would work. The parent of the script is the PlayerGui and the parent of PlayerGui is the player itsself. Character is a property of that player, it would be the same if I did localplayer, and that doesn't work either. Thanks for trying though! B-D CubicleCurse 5 — 8y
Ad

Answer this question