How can I make a player's in-game points not drop below zero?
✓ ANSWER ACCEPTED
How to make a player's leaderstats not go below zero?
1 answer
✓ Accepted answer
well first set points and check to see if it doesn't go below zero like so
In a script not localscript
function CheckPoints(Points)
if Points.Value < 0 then
Points.Value = 0
end
end)
game.Players.PlayerAdded:connect(function(Player) --anonymous function
local ls = Instance.new("Configuration", Player)
ls.Name = "leaderstats"
local Points = Instance.new("IntValue", ls) -- classname, parent
Points.Name = "Points"
Points.Changed:connect(function() CheckPoints(Points) end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks!