CurrentPrice = script.Parent.Worth
Debounce = true
PickedUp = false
script.Parent.Touched:Connect(function(hit)
if Debounce and hit.Parent.Parent:FindFirstChild("Humanoid") and hit.Parent.Name == "Trashpick" and not PickedUp then
print("Trash is now PickedUp")
Debounce = false
script.Parent.Transparency = 1
local player = game.Players:GetPlayerFromCharacter(hit.Parent.Parent)
player:FindFirstChild("leaderstats")
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + CurrentPrice.Value
print("Player picked up trash")
PickedUp = true
wait(10)
PickedUp = false
script.Parent.Transparency = 0
end
end)
Here is my script, It works fine BUT it does not work MULTIPLE times. I would want to after the Transparency is set to = 0 I want the script to be working again, please help!

1 comment
Try using while true do