game.Players.PlayerAdded:Connect(function(player) local stats = Instance.new("Folder", player) stats.Name = "leaderstats" local points = Instance.new("IntValue",stats) points.Name = "Points" end) while true do local points = player.leaderstats.Points points = points + 1 wait() end
game.Players.PlayerAdded:Connect(function(player) local stats = Instance.new("Folder", player) stats.Name = "leaderstats" local points = Instance.new("IntValue",stats) points.Name = "Points" while true do local points = player.leaderstats.Points points.Value = points.Value + 1 wait() end end)
If you are going to say “player” you must include it in the function that you used the argument in. Outside of the function, “player” has no definition.
You also need to add the +1 to the points, and without saying value, the script thinks you are trying to add numbers to just a variable that has no number correlation.
Hopefully this helps you! :)