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

Attempt To Index Nil With Character?

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:wait()

For some reason it don't work, can someone help?

1 answer

✓ Accepted answer

The local player can only be accessed from the client, it won't work on the server as the server is not associated with any of the clients therefore local player will be nil.

To fix this, you'd have to use a local script to get the local player, or use a RemoteEvent if you need this to be done on the server.

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