I made a punch script that plays an animation, but i want to make the animation play differently the next time the player clicks, how can i do that? (btw i want it to play 3 different animations and loops back to the first animation)
local Punch = script:WaitForChild("Punch") local animTrack = Humanoid:LoadAnimation(Punch) animTrack:Play(0,2,2.5)
^ this is just a small part of my script
Make a variable, set it to 1, check for it, increase its value and finally reset it.
...example:
local currentAttack = 1 function punch() if currentAttack == 1 then --play your first animation currentAttack = 2 elseif currentAttack == 2 then --play your second animation currentAttack = 3 elseif currentAttack == 3 then --play your third animation currentAttack = 1 end end