Hello, Im OriginalDevelops! Im trying to make a toggle with 2 attack sword that repeat and having a debounce, but the problem is the debounce, it didnt have any cooldown or debounce, anyways, the toggle still having a good work, this is my script, I hope someone can solve this for me with this!
local toggle = false
local animation2 = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Slash2)
local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Slash)
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if not toggle then
toggle = false
animation:Play()
script.Parent.Handle.SwordSlash:Play()
wait(1)
toggle = true
elseif toggle == true then
toggle = true
animation2:Play()
script.Parent.Handle.SwordSlash:Play()
wait(1)
toggle = false
end
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
animation2:Stop()
end)

2 comments
Ahh, Im Not currently in studio but I will still accpect your answer, hope it works!
Well thanks, if it doesn't let me know