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!
REPOST FROM ZAFIRUA CREDIT FOR SOLVING IT
local Player = game:GetService("Players").LocalPlayer