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

Why this localscript is not working?

**The script should make a Part that go into the model StoreModel, but dont do anything. There is no error just that the part does no create :S

THE SCRIPT IS INTO A LOCALSCRIPT THAT IS IN STARTERGUI**

local Player = game.Players.LocalPlayer:WaitForChild("Character")
local rArm = Instance.new("Part",Workspace.StoreModel)
rArm.CanCollide = true
rArm.Anchored = false
rArm.BottomSurface = "Smooth"
rArm.TopSurface = "Smooth"
rArm.Position = Player:FindFirstChild("Right Arm").Position

1 answer

The Character is not a child of the player. It's a property.

WaitForChild will simply wait forever.


You have to cause it to wait yourself:

while not player.Character do
	wait()
end

Or, if you're willing to restructure your code a little, you can use the CharacterAdded event (though this makes things slightly more complicated, too).

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