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

Is not a valid member of part?

hey everyone, can someone help me out with this code? why doesnt it work?

local player = game.Players.LocalPlayer
local char = player.Character
local rS = char.Torso("Right Shoulder")

print(rS)

3 comments

0

local rS = char.Torso:WaitForChild('Right Shoulder')?

0

thank you!

0

Np.

1 answer

You're likely getting this error because the character hasn't loaded in before the code is run. Try this:

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local rS = char.Torso("Right Shoulder")
print(rS)

1 comment

0

Use WaitForChild or square brackets for that.

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