So everything is fine just when it says Owned, you can buy the weapon more than once, how do I make it to where you can only buy it once?
local player = game.Players.LocalPlayer
local rs = game.ReplicatedStorage
local tool = rs.HyperlaserGun
local stats = player.leaderstats
local button = script.Parent
price = 100
script.Parent.MouseButton1Click:Connect(function()
if stats.Cash.Value >= price then
button.Text = 'Owned'
stats.Cash.Value = stats.Cash.Value - price
local clone = tool:Clone()
clone.Parent = player.Backpack
local cloneforstartergear = tool:Clone()
cloneforstartergear.Parent = player.StarterGear
else
button.Text = 'Failed'
wait(1)
button.Text = 'Buy'
end
end)

2 comments
Line 17 dont use the = only use the >
if player already has the tool then destroy the gui else dont destroy the gui