How can I make the game tell that I already have the item in my backpack so it doesn't repeat its purchase?
local price = script.Parent.Parent.Price
local tools = game.ReplicatedStorage:WaitForChild("Tools")
local tool = script.Parent.Parent.ItemName
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if player.leaderstats:FindFirstChild("Cash").Value >= price.Value then
player.leaderstats:FindFirstChild("Cash").Value = player.leaderstats:FindFirstChild("Cash").Value - price.Value
game.ReplicatedStorage.ShopBuy:FireServer(tool.Value)
end
end)

1 comment
Thanks!