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

Weird Outputs Please Help?

Output 06:25:28.242 - Workspace.Script:2: attempt to index field 'Character' (a nil value)

game.Players.PlayerAdded:connect(function(p)
	p.Character.Head.BrickColor = BrickColor.new("Bright red")
end)

Happens to all my scripts

1 answer

✓ Accepted answer

The function you are using is for when a player first joins the game. The Character would not have spawned yet, he/or she would still be loading. Anyhow you should also look at the Wiki.Roblox.Com/ I'm pretty sure they have the info t fix your problem.

But anyhow I will help.

--Server Sided Script

game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
Character.Head.BrickColor =  BrickColor.new("Bright red")
end)
end)

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