Jump to content

Animation timer


Cynoq

Recommended Posts

Posted

(Original)

setTimer(function() 
    Anim,_ = getPedAnimation(getLocalPlayer()); 
    if (Anim) then 
        setPedAnimation(getLocalPlayer(), false); 
    end 
end, 2000, 0); 

This script stops all animations after 2 seconds. I want it to only stop one certain animation.

I do not have any experience with lua so I have no idea on what to do. This is my idea and maybe someone

that knows lua could fix the syntax or make a script just like this. \/

(changes on line 3 from original)

setTimer(function() 
    Anim,_ = getPedAnimation(getLocalPlayer()); 
    if (Anim) == (AnimationIWantTostop) then 
        setPedAnimation(getLocalPlayer(), false); 
    end 
end, 2000, 0); 

Thanks !

Posted
I don't understand lua, that's the thing. And I don't wanna have to learn a whole language to fix one little problem...

will stay a lifetime in need of help?

have to study a little too ... :wink:

Posted
I don't understand lua, that's the thing. And I don't wanna have to learn a whole language to fix one little problem...

will stay a lifetime in need of help?

have to study a little too ... :wink:

It's not hard for someone who already knows lua to add a "if equal to" to a script c'mon, I'm not asking for much...

Posted
It's not hard for someone who already knows lua to add a "if equal to" to a script c'mon, I'm not asking for much...

a Okay paste all code

Posted
It's not hard for someone who already knows lua to add a "if equal to" to a script c'mon, I'm not asking for much...

a Okay paste all code

What? The code I want fixed is at the top.

Posted

maybe try this

    if getPedAnimation(getLocalPlayer()) then 
        setTimer(function() setPedAnimation(localPlayer) end, 2000, 0) 
    end 

Posted
maybe try this
    if getPedAnimation(getLocalPlayer()) then 
        setTimer(function() setPedAnimation(localPlayer) end, 2000, 0) 
    end 

Nope, doesn't stop any animation

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...