function onPlayerEntered(a)
local b = Instance.new("IntValue")
b.Name = "leaderstats"
local c = Instance.new("IntValue")
c.Name = "Points"
c.Value = 0
c.Parent = b
b.Parent = a
end
game.Players.ChildAdded:connect(onPlayerEntered)
while wait(1) do
game.Players.localPlayer.leaderstats["Points"].Value = game.Players.localPlayer.leaderstats["Points"].Value + 1
end
The script works in studio, but I get 'attempt to index field 'localPlayer' (a nil value) while actually playing the game and looking at the dev console.

6 comments
I have a problem. I have an ingame store, and when something is bought using these points the player's amount of points is approperiately subtracted by the cost of the item. However, about one second later the amount of points which the player has reverts back to the amount of points the player had before the charge. Also this is the script for the store.script.Parent.Text = tostring(script.Parent
Filtering is Enabled. Modifications through a local script (aka the client) will only appear to be modified until the server updates whatever you changed. Try using a remote
The thing is, the point value appears to be modified by the charge on the leaderboard, however it reverts back. It seems like it reverts back when a new point is added.
I tested it without FE and it appears to do the same thing.
Are you modifying the values in a local or server script?
Why you dont use a local like local Player = game:WaitForChild('Players').LocalPlayer