I need to know how to make it so that when a weapon is playing a draw animation, it can't be interrupted by shooting or reloading etc until the animation has finished.
why not a timer that just stops the player from firing, reloading, etc. if the animation is playing
or maybe a check if the animation is playing, if those exist
[QUOTE=Kung Fu Jew;34025855]why not a timer that just stops the player from firing, reloading, etc. if the animation is playing
or maybe a check if the animation is playing, if those exist[/QUOTE]
I think there were 'Is Animation Finished' tests in Source, but it depends if Garry exposed them with Lua... Or if they exist at all outside my imagination.
[B]edit:[/B]
This wouldn't happen to be it, would it?
[B][URL="http://wiki.garrysmod.com/?title=Entity.SequenceDuration"]Entity.SequenceDuration [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B]
[QUOTE=Kung Fu Jew;34025855]why not a timer that just stops the player from firing, reloading, etc. if the animation is playing
or maybe a check if the animation is playing, if those exist[/QUOTE]
[QUOTE=IceBreaker88;34026482]I think there were 'Is Animation Finished' tests in Source, but it depends if Garry exposed them with Lua... Or if they exist at all outside my imagination.
[B]edit:[/B]
This wouldn't happen to be it, would it?
[B][URL="http://wiki.garrysmod.com/?title=Entity.SequenceDuration"]Entity.SequenceDuration [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B][/QUOTE]
Could you guys give me an example on how to do it the ways your explaining? Like a line of code or something.
Anyone?
I don't work much with Sweps, but i'll see what i can do when i get home today, to give you an example.
This seems to be working for Deploying your swep, just add this to your current Deploy function
[lua]
//Add this BEFORE you return from the function
self:SetNextPrimaryFire( CurTime() + self:SequenceDuration())
self:SetNextSecondaryFire( CurTime() + self:SequenceDuration())
self:NextThink( CurTime() + self:SequenceDuration() )
[/lua]
I'm working to see if i can add a delay to the Holster function, but i'm unsure if its possible.
Sorry, you need to Log In to post a reply to this thread.