generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Wait between animations...?

Previous Thread :: Next Thread 
Iliuminatis is not online. Iliuminatis
Joined: 30 Nov 2008
Total Posts: 1524
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 is not online. 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
Iliuminatis is not online. Iliuminatis
Joined: 30 Nov 2008
Total Posts: 1524
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 is not online. 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
Iliuminatis is not online. Iliuminatis
Joined: 30 Nov 2008
Total Posts: 1524
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image