So I have some scripts that include the line game.Players.LocalPlayer but in an actual game they wont work. Any idea why ? Heres a script.

local plr = game.Players.LocalPlayer
local GUI = plr.PlayerGui.AFK.AFK
script.Parent.MouseButton1Click:Connect(function()
	plr.AFK.Value = 0
	wait(.1)
	GUI.noAFK.Visible = false
	GUI.AFK.Visible = true
end)

3 comments

0

Is this a script or a localscript?

0

If this is a regular script it will not work. Read up on localscripts vs scripts

0

ok