So, I've done a few attempts of a script and I get that same error message all the time -
14:13:23.119 - Workspace.Grab.Script:2: attempt to index global 'player' (a nil value)
It doesn't matter if it's a LocalScript or a Script, or has a Local infront of the line.
player = game.Players.LocalPlayer
Character = player.Character
After many attempts of different combinations I started to doubt of the existence of LocalPlayer since Roblox has went through a few updates...
Here's what I did to see if LocalPlayer is found or not:
if game.Players.LocalPlayer then
print("LocalPlayer found!")
else if not game.Players.LocalPlayer then
print("LocalPlayer not found!")
end
end
And I got "LocalPlayer not found!"
I also noticed that my scripts disappear from my character when I test my game...

8 comments
LocalPlayer can only be used in a LocalScript
I already tried it, but the error message is the same...
print(game.Players.LocalPlayer)
it may because the script runs faster than the games does
That is wrong. LocalPlayer will never be nil on the client side. OP just being big dum dum
Using that printing code given by Incapaxx I get 'Nil'
On the server side, yes. Client side, no.
So, how to fix that?