Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a player's leaderstats not go below zero?

Asked by 10 years ago

How can I make a player's in-game points not drop below zero?

1 answer

Log in to vote
0
Answered by 10 years ago

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)
0
Thanks! DrCylonide 158 — 10y
Ad

Answer this question