Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt To Index Nil With Character?

Asked by 4 years ago
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:wait()

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

1 answer

Log in to vote
0
Answered by 4 years ago

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.

Ad

Answer this question