I want to make a sword that will lunge when the mouse is pressed and will swing when released? This is my first approach but swing animation sometimes plays even if lunge isn't played yet. I'm really struggling with this. You can run this at Roblox Studio to understand what I mean.
script.Parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
if not debounce then
debounce = true
lunge:Play()
debounce = false
end
end)
mouse.Button1Up:Connect(function()
if not debounce then
debounce = true
lunge:Stop()
slash:Play()
wait(1)
slash:Stop()
debounce = false
end
end)
end)

2 comments
Try adding a wait() between when the lunge stops and slash plays.
nothing changed