1

# How do I make leaderstats not go below zero?

In the shop when you buy something, if you dont have enough money instead of stopping you the leaderstat amount will go below zero, how do I stop this?

0
Can you show us the script? guuguu058 9 — 16d

0
Edited 16 days ago

Im assuming for your script you did something a little like this

script.Parent.MouseButton1Click:Connect(function(player)
player.leaderstats.stat.Value -= 30  -- 30 is just a placeholder value

-- whatever the code is for when its bought

end)


script.Parent.MouseButton1Click:Connect(function(player)
if player.leaderstats.stat.Value >= 30 then -- ">=" means greater than, or equal to