if StaminaValue.Value == 0 then return end
tool.Activated:connect(function()
	
	if humanoid and humanoid.Health > 0 then
	if Swing1Play.Value ~= true then
	Swing1Play.Value = true
		StaminaValue.Value = StaminaValue.Value - 5
	playSwing1 = humanoid:LoadAnimation(swing1)
	playSwing1:Play()
	swooshSound:Play()
	
	wait(.7)
	Swing2Play.Value = false
		tool.Activated:connect(function()
		
			if humanoid and humanoid.Health > 0 then
			if Swing2Play.Value ~= true  and playSwing1 then
			Swing2Play.Value = true
				StaminaValue.Value = StaminaValue.Value - 5
			playSwing2 = humanoid:LoadAnimation(swing2)
			playSwing2:Play()
			swooshSound:Play()
			
			wait(.7)
			Swing3Play.Value = false
				tool.Activated:connect(function()
			if humanoid and humanoid.Health > 0 then
			if Swing3Play.Value ~= true  and playSwing2 then
			Swing3Play.Value = true
				StaminaValue.Value = StaminaValue.Value - 5
			playSwing3 = humanoid:LoadAnimation(swing3)
			playSwing3:Play()
			swooshSound:Play()
			
			wait(.7)
			Swing4Play.Value = false
				tool.Activated:connect(function()
			if humanoid and humanoid.Health > 0 then
			if Swing4Play.Value ~= true  and playSwing3 then
			Swing4Play.Value = true
				StaminaValue.Value = StaminaValue.Value - 5
			playSwing4 = humanoid:LoadAnimation(swing4)
			playSwing4:Play()
			swooshSound:Play()
			
			wait(.7)
			Swing1Play.Value = false
			end
			end
	end)
			end
			end
	end)

			end
			end
	end)
	end
	end
	
	
end)

3 comments

0

Be more specific with what you're asking. What condition?

0

lets say if the value of stamina is less than 0

0

Replace the ' == 0' with '<= 0'. '<=' means less than or equal to. In the future, please explain what you're asking in the question.