Animations getting spammed

Hi,

I was making animations for a climb script but the animations keep getting spammed. I don’t know how I would fix this problem.

run.RenderStepped:Connect(function()
	local strafe = actions[2] - actions[1]
	local surge = actions[3] - actions[4]
	
	climbMove.Velocity=rootpart.CFrame.RightVector*(strafe*8)+Vector3.new(0, surge*-8, 0)
--idle	
if actions[1] == 0 and actions[2] == 0 and actions[3] == 0 and actions[4] == 0 and climbing then
		ClimbIdle:Play()
	else
		ClimbIdle:Stop()
	end
--left
if actions[1] == 1 and actions[2] == 0 and actions[3] == 0 and actions[4] == 0 and climbing then
		ClimbLeft:Play()
	else
		ClimbLeft:Stop()
	end
--right
if actions[1] == 0 and actions[2] == 1 and actions[3] == 0 and actions[4] == 0 and climbing then
		ClimbRight:Play()
	else
		ClimbRight:Stop()
	end
--down
if actions[1] == 0 and actions[2] == 0 and actions[3] == 1 and actions[4] == 0 and climbing then
		ClimbDown:Play()
	else
		ClimbDown:Stop()
	end
--up
if actions[1] == 0 and actions[2] == 0 and actions[3] == 0 and actions[4] == 1 and climbing then
		ClimbUp:Play()
	else
		ClimbUp:Stop()
	end
end)

Try adding a wait() somewhere in there to delay the actions.

I fixed this problem using the IsPlaying property of the animation.