local player = game.Players.LocalPlayer while true do wait(20) player.leaderstats.Points.Value=player.leaderstats.Points.Value+20 end
output: 15:41:49.796 - ServerScriptService.overtime:5: attempt to index local 'player' (a nil value) 15:41:49.797 - Stack Begin 15:41:49.797 - Script 'ServerScriptService.overtime', Line 5 15:41:49.797 - Stack End
Try putting this in a ServerScript
in StarterPack
or StarterGui
.
local Player = script.Parent.Parent -- Converted from game.Players.LocalPlayer. local Stats = Player:WaitForChild("leaderstats") -- Waits to continue until leaderstats are loaded while wait(20) do -- You can convert "while true do wait(20) end" to "while wait(20) do end". Stats.Points.Value = Stats.Points.Value + 20 end