Ok, so the so it does only allow you to buy the tool once the it says "bought". But then you go to another tool it still says "bought" and not "buy" and you're not able to buy it. So how do I make it to where it says buy for tools that aren't bought. Here the button script.
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
local db = false
script.Parent.MouseButton1Click:connect(function()
if db == false then
if player.leaderstats:FindFirstChild("Money").Value >= price.Value then
player.leaderstats:FindFirstChild("Money").Value = player.leaderstats:FindFirstChild("Money").Value - price.Value
game.ReplicatedStorage.ShopBuy:FireServer(tool.Value)
db = true
script.Parent.Text = "Bought"
elseif not (player.Backpack:FindFirstChild(tool.Value) or player.Character:FindFirstChild(tool.Value) or player.StarterGear:FindFirstChild(tool.Value)) then
script.Parent.Text = "Buy"
if player.leaderstats:FindFirstChild("Money").Value >= price.Value then
player.leaderstats:FindFirstChild("Money").Value = player.leaderstats:FindFirstChild("Money").Value - price.Value
game.ReplicatedStorage.ShopBuy:FireServer(tool.Value)
db = true
end
end
end
end)

2 comments
Ill check
I checked evrything and now it takes away the momey but can still only buy one tool. And nothing says bought.