Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make an animation not play until another animation has been played?

Slash sometimes play even lunge haven't been played yet.

script.Parent.Equipped:Connect(function(mouse)

	mouse.Button1Down:Connect(function()
			debounce = true
			lunge:Play()
	end)


	mouse.Button1Up:Connect(function()
			CanDamage.Value = true
			lunge:Stop()
			slash:Play()
			wait(1)
			slash:Stop()
	end)
end)

3 comments

0

lunge.Stopped:Wait()

0

where should I put it?

0

Is the lunge animation looped or not?

1 answer

✓ Accepted answer

This script just adds a debounce to make sure the player has lunged before the player can slash.
Unfortunately, you didn't provide as much information as needed, so I don't know exactly what the problem is, but this may help answer it.

	local hasLunged = false -- new debounce
	script.Parent.Equipped:Connect(function(mouse)
	 
	    mouse.Button1Down:Connect(function()
		  lunge:Play()
	  	 	 wait() -- how long u want it to last
			lunge:Stop()
		hasLunged = true -- the player has used lunge
		
		end)
	 
	 
	    mouse.Button1Up:Connect(function()
	         if hasLunged = true then -- only plays if the player has lunged
		    CanDamage.Value = true
	            slash:Play()
	            wait(1)
	            slash:Stop()
	    	    Haslunged = false
			end
		end)
	end)

4 comments

0

Ofc you don't need the wait() if lunge is not looped

0

if it works than u should accept the answer so people know it answered.

0

wow. i actually just gave on this project since i really dont know to fix this. thank you anyways

0

lol

This discussion is preserved as it was. New answers, comments, and votes are closed.