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

torso is not a valid member of Model??

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?

1 comment

0

I fixed it, it was because I did not use WaitForChild. The script ran before my torso was created, causing it to error.

1 answer

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)

1 comment

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

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