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
local ToolNames = {"BetterTool"} local Storage = game:GetService("ServerStorage") local currencyy = game.Players.LocalPlayer.leaderstats.LemonsAte local Part = script.Parent local ClickDetector = Part:WaitForChild("ClickDetector") ClickDetector.MouseClick:connect(function(Player) if Player and Player.Character and currencyy.Value > 99 then local Backpack = Player:WaitForChild("Backpack") for i = 1, #ToolNames do local Tool = Storage:FindFirstChild(ToolNames[i]) if Tool then currencyy.Value =- 100 Tool:clone().Parent = Backpack end end end end)