So, my code is when I press "e" it destroys a model that is called Common Bacon and gives me ten coins. BUT, after that I can press e still and it'll STILL give me 10 coins, I want it to only give me ten coins if the Model "Common Bacon" is still there. Here's my code
local Plr = game.Players.LocalPlayer
local model = workspace.CommonBacon
local amountofcoins = 10
Plr:GetMouse().KeyDown:Connect(function(Key)
if Key == "e" then
wait (0.5)
model:Destroy()
Plr.leaderstats.Coins.Value = Plr.leaderstats.Coins.Value +10
end
end)

1 comment
You never used amountofcoins, use an if statement, if model then on line 8