I have a debounce that should make it take 5 seconds to use this hopperbin again. However, it doesn't work! It works a little, but not for 5 seconds. Please help.
local tool = script.Parent
local plr = tool.Parent.Parent
local db = false
tool.Selected:connect(function(mouse)
mouse.Button1Down:connect(function()
if db == false then
db = true
local target = mouse.Target
print(target)
if game.Players:GetPlayerFromCharacter(target.Parent) then
if (target.Parent.Torso.Position - plr.Character.Torso.Position).magnitude <= 7 then
target.Parent.Torso.Velocity = plr.Character.Torso.CFrame.lookVector * 150
end
end
end
wait(5)
db = false
end)
end)

1 comment
Thanks!