For example, if someone buys something from my shop, they loose that amount of money but get the item, so lets say an item happens to be 3000 points and they buy it. If they suddenly to gain a point, for example 1, it goes straight to 3001. So the previous number + the points they just gained. You know what I mean? Here
local CountName = "Points"
game.Players.PlayerAdded:connect(function(Player)
local leaderstats = Player:FindFirstChild('leaderstats') or Instance.new("Folder", Player)
leaderstats.Name = "leaderstats"
local Points = leaderstats:FindFirstChild(CountName) or Instance.new("IntValue", leaderstats)
Points.Name = CountName
Points.Value = 0
Player.CharacterAdded:connect(function(Character)
local d = true
Character:WaitForChild("Humanoid").Died:connect(function()
if (d) then
d = false
Points.Value = Points.Value + 100
end
end)
end)
end)
By the way, this is the script that people earn points from. All I need is the points to not reset after they buy something.

3 comments
Parent argument is deprecated.
why did you name leaderstats after finding it in player? if the leaderstats is not named before trying to find it, it won't find it.
????I guess set a value of how many points get taken away? I am confused....