So what i have here is 2 animations.
What i want is that when u click the first animations plays. when u click again the second one plays. and so on and on like 1,2,1,2,1,2,12
I tried creating this block of code for it, however it still only plays the first animation?. Anyone can help me with this?
script.Parent.Activated:Connect(function()
local animation1 = script.Animation1
local animation2 = script.Animation2
local humanoid = script.Parent.Parent.Humanoid
local animationtrack1 = humanoid:LoadAnimation(animation1)
local animationtrack2 = humanoid:LoadAnimation(animation2)
local t = 1
if t == 1 then
animationtrack1:Play()
t = 2
elseif t == 2 then
animationtrack2:Play()
t = 1
end
end)