So I have a working buying button but the player is able to get the button after 10 seconds if they got one already. So they can keep getting if they have enough money(which I don't want them to get more than 1). Once they have one, want to prevent them from getting another. I HAVE NO CLUE ON HOW TO DO THIS! Thanks for the help, please explain a little.
d = true
script.Parent.Touched:connect(function(hit)
local hum = hit.Parent:WaitForChild("Humanoid")
local tool = game.ServerStorage:WaitForChild("GravityCoil")
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = plr:WaitForChild("leaderstats").Tags
if d then
if stats.Value >= 50 then
d = false
if hum then
tool:Clone().Parent = plr.Backpack
stats.Value = stats.Value - 10
end
wait(10)
if plr.Backpack.Tool then
--code?
end
d = true
end
end
end)

2 comments
Did you miss some code?
I don't think so. Why any problems?