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: Confused on what an AnimationTrack is, and how to define it.

Previous Thread :: Next Thread 
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
01 Aug 2016 09:59 AM
Im creating a cooldown on a knife animation, how do I do the Stopped event on the AnimationTrack? How do I even define it? Im confused, because the API:Class says it cannot be created.


Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
01 Aug 2016 10:01 AM
bump pl0x


Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
01 Aug 2016 12:41 PM
boop


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
01 Aug 2016 12:44 PM
I don't quit understand the question. this is usually how I load animations.


local Animation = "LocationHere"
local Humanoid = "LocationHere"
local AnimTrack = Humanoid:LoadAnimation(AnimTrack)


And then you can use, AnimTrack:Play() and AnimTrack:Stop()


Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
01 Aug 2016 12:49 PM
Alright, i need the event Stopped to fire. But im not sure how to write it.
This doesnt work:
local insterpath = workspace.Path.ToAnimation
local animation = player.Character.Humanoid:LoadAnimation(instertpath)

animation.Stopped:connect(function(bob)
--code
end)

error:
animation is a nil value.

But that cant be it, because the animation plays!
And if I go:

insertpath.Stopped:connect(function(bob)
--code
end)

Then it says Stopped isnt a member of Animation.
????


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
01 Aug 2016 12:52 PM
Uhh, maybe if the Animation is not looped you can do a cooldown by doing this:


wait(AnimationLength)
CoolDownFinished = true

I forgot if AnimationLength is an actually property. I'm not sure.


Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
01 Aug 2016 12:55 PM
Well the animation starts by an OnClick function, so basically I would have to start the timer by when you click. Problem is, if you spam click, it offsets the wait time. Making it spammable. (Ive tried RIP) And yes, this Stopped Event exists.

http://wiki.roblox.com/index.php?title=API:Class/AnimationTrack/Stopped


Report Abuse
InfiniteYield is not online. InfiniteYield
Joined: 01 Mar 2012
Total Posts: 762
01 Aug 2016 05:43 PM
i will not be ignored.


Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
01 Aug 2016 06:30 PM
Uhh try this

local CoolDown = false
--Make sure to define AnimTrack and all that stuff again


local function WhenActivated() --Whenever you press tool
if CoolDown == false then
CoolDown = true
wait(AnimTrack.Length)
CoolDown = false
end
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