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

Not Accessing the LocalPlayers Arms?

Hi, when this script is run in studio, it works fine. However, in game, I get this error: Right Arm is not a valid member of Model.

Extra Information: LocalScript inside Starterpack.

Do not pay attention to the commented lines of code.


local player = game.Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
	character = player.CharacterAdded:wait()
game.Players.LocalPlayer.Character["Right Arm"].Transparency = 1
game.Players.LocalPlayer.Character["Left Arm"].Transparency = 1
--game.Players.LocalPlayer.Character.Torso.Transparency = 1
local arm1 = script.Placearmsinhere.RightArm:Clone()

arm1.Parent = game.Workspace

local arm2 = script.Placearmsinhere.LeftArm:Clone()
arm2.Parent = game.Workspace

--local torso = script.Placearmsinhere.Torso:Clone()
--torso.Parent = game.Players.LocalPlayer.Character

wait(1)


local weld1 = Instance.new("Weld")
weld1.Parent = game.Players.LocalPlayer.Character.Torso
weld1.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
weld1.Part0 = arm1
weld1.C0 = CFrame.Angles(0, 0 ,0 )

local weld2 = Instance.new("Weld")
weld2.Parent = game.Players.LocalPlayer.Character.Torso
weld2.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
weld2.Part0 = arm2
weld2.C0 = CFrame.Angles(0, 0 ,0 )

--[[local weld2 = Instance.new("Weld")
weld2.Parent = game.Players.LocalPlayer.Character.Torso
weld2.Part1 = game.Players.LocalPlayer.Character.Torso
weld2.Part0 = torso
weld2.C0 = CFrame.Angles(0, 0 ,0 )
]]

end

1 answer

Try adding below line 4 this script:

repeat wait() until character:FindFirstChild("Right Arm")  ~= nil and character:FindFirstChild("Left Arm") 

The Error can be caused by the Arms not being loaded yet, when you try to get them.

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