|
| 30 Jun 2016 03:26 AM |
local SwingAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("Swing")); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(2.1+(math.random()*0.2));
So this is single Swing animation. I need Humanoid to perform another animation exactly after this one has ended. |
|
|
| Report Abuse |
|
|
Meowth552
|
  |
| Joined: 17 Dec 2009 |
| Total Posts: 2181 |
|
|
| 30 Jun 2016 04:30 AM |
local SwingAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("Swing")); local yAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("y")); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(2.1+(math.random()*0.2)); yAnimation:Play(); yAnimation:AdjustSpeed(2.1+(math.random()*0.2)); |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2016 06:11 AM |
local SwingAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("Swing")); local yAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("y")); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(2.1+(math.random()*0.2)); yAnimation:Play(); yAnimation:AdjustSpeed(2.1+(math.random()*0.2));
This makes animations overlap, causing only 1 of the animations play. |
|
|
| Report Abuse |
|
|
Meowth552
|
  |
| Joined: 17 Dec 2009 |
| Total Posts: 2181 |
|
|
| 01 Jul 2016 10:40 AM |
Ah, sorry.
local SwingAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("Swing")); local yAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("y")); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(2.1+(math.random()*0.2)); wait(1) yAnimation:Play(); yAnimation:AdjustSpeed(2.1+(math.random()*0.2)); |
|
|
| Report Abuse |
|
|
|
| 01 Jul 2016 10:51 AM |
I have another issue. I have nearly 2 seconds long animation and my script repeats this attack animation every 0.3 seconds.
I tried changing wait times, making them longer just makes the animation to not play or become even shorter. Animation ends before it finishes.
possibleAnims = { "Slash" } local ZombieScript=script; local ZombieHumanoid = script.Parent.Enemy;
while wait(0.3) do local p = game.Players:GetChildren() for i = 1,#p do if p[i].Character~=nil then if p[i].Character:findFirstChild("Torso")~=nil then if (p[i].Character.Torso.Position - script.Parent.Torso.Position).magnitude < 8 then local SwingAnimation=ZombieHumanoid:LoadAnimation(ZombieScript:FindFirstChild("Swing")); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(1.5+(math.random()*0.2)); end end end end wait(0.3) end |
|
|
| Report Abuse |
|
|