How do I make my purchase script only work if they have 100 or more and subtract?
So I am making a game called Lemonade Break and I am working on making a script that will have you purchase items when you click on them, but it wont subtract the money, and I am trying to only make it work if they have 100 currency or more
01 | local ToolNames = { "BetterTool" } |
02 | local Storage = game:GetService( "ServerStorage" ) |
03 | local currencyy = game.Players.LocalPlayer.leaderstats.LemonsAte |
05 | local Part = script.Parent |
06 | local ClickDetector = Part:WaitForChild( "ClickDetector" ) |
08 | ClickDetector.MouseClick:connect( function (Player) |
09 | if Player and Player.Character and currencyy.Value > 99 then |
10 | local Backpack = Player:WaitForChild( "Backpack" ) |
11 | for i = 1 , #ToolNames do |
12 | local Tool = Storage:FindFirstChild(ToolNames [ i ] ) |
14 | currencyy.Value = - 100 |
15 | Tool:clone().Parent = Backpack |