Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need help coding this localscript help please?

Asked by 9 years ago

Sup, When you left click it will play the first animation and if you left click again before 0.5 seconds it will play the second animation like I want it too. How can I get this script to play the third and fourth animations like I have it for the first two animations?

I messed around with it and the 'return' helps me for the first and second animations but it will only play the first animation after the second animation instead of the third animation then the fourth like I want it.

local animation = Instance.new("Animation")

animation.AnimationId = "rbxassetid://188046705" --BATK1


game.Players.LocalPlayer:GetMouse''.Button1Down:connect(function()

local character = Player.Character

animTrack = character:WaitForChild("Humanoid"):LoadAnimation(animation)

animTrack:Play()
wait(0.5)
animTrack:Stop()
wait(5)
return


end)

if animation.AnimationId ~= nil then

local animationSecond = Instance.new("Animation")

animationSecond.AnimationId = "rbxassetid://188253235" --BATK2

game.Players.LocalPlayer:GetMouse''.Button1Down:connect(function()

local character = Player.Character

animTrack = character:WaitForChild("Humanoid"):LoadAnimation(animationSecond)
animTrack:Play()
wait(0.1)
animTrack:Stop()
wait(5)

end)
end

if animation.AnimationId ~= nil then

local animationThird = Instance.new("Animation")

animationThird.AnimationId = "rbxassetid://188259240" --BATK3

game.Players.LocalPlayer:GetMouse''.Button1Down:connect(function()

local character = Player.Character

animTrack = character:WaitForChild("Humanoid"):LoadAnimation(animationThird)

animTrack:Play()
wait(0.1)
animTrack:Stop()
wait(5)

end)
end

if animation.AnimationId ~= nil then

local animationFourth = Instance.new("Animation")

animationFourth.AnimationId = "rbxassetid://188260074" --BATK4

game.Players.LocalPlayer:GetMouse''.Button1Down:connect(function()

local character = Player.Character

animTrack = character:WaitForChild("Humanoid"):LoadAnimation(animationFourth)

animTrack:Play()
wait(0.1)
animTrack:Stop()
wait(5)

end)
end
0
Please provide any output available. ChipioIndustries 454 — 9y

Answer this question