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

help with calling localplayer?

I have looked at the other asks and saw the solution, however it does NOT work and I get the same error when trying to call localplayer! My localscript is in a gui button btw.


local players = game.Player.LocalPlayer

error: attempt to index localplayer(a nil value)

4 comments

0

HELP ME

0

You forgot the "s" at the end of game.Player. The player service is plural.

0

O yeah forget that I meant to put an S.... but still I dont know whats goin on...

0

you can only use game.Players.LocalPlayer on a LocalScript.

1 answer

✓ Accepted answer

You forgot to put a S in your script it should be like this

local player = game.Players.LocalPlayer --I changed pllayers to player since this is not the whole group of people--

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