I tried several ways to stop this script from allowing you to buy the items more than once but nothing is working.
player = script.Parent.Parent.Parent.Parent.Parent money = player.leaderstats.Credits price = script.Parent.Price.Value tool = game.ReplicatedStorage:findFirstChild("TG45") function buy() if money.Value >= price then money.Value = money.Value - price local a = tool:clone() a.Parent = player.Backpack player.GearStats.TG45.Value = true end end script.Parent.MouseButton1Down:connect(buy)
check if the player already has the tool in their backpack
player = script.Parent.Parent.Parent.Parent.Parent money = player.leaderstats.Credits price = script.Parent.Price.Value tool = game.ReplicatedStorage:findFirstChild("TG45") function buy() if money.Value >= price then if player.Backpack:FindFirstChild(tool) == nil then if money.Value >= price then money.Value = money.Value - price local a = tool:clone() a.Parent = player.Backpack player.GearStats.TG45.Value = true end end end script.Parent.MouseButton1Down:connect(buy)