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

Yeah I already asked this but I need more help .-. anyone?

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. view source

local players = game.Players.LocalPlayer

error: attempt to index localplayer(a nil value)

also thanks to scriptguider for pointing something out!

5 comments

0

Not sure if this is the issue, but you have to wait for your player to be loaded. This included the model, scripts, guis, etc... before that line if you wait for the character to load it might help

0

the script has a gui button so the character is already loaded.... thx anyway!

0

local Player = game:GetService("Players").LocalPlayer;

0

hmm I will try that!

0

THANK YOU SOOO MUCH I HAVE BEEN SOOO IRRITATED BY THIS!

1 answer

REPOST FROM ZAFIRUA CREDIT FOR SOLVING IT

local Player = game:GetService("Players").LocalPlayer

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