Jump to content

Freeze after talk animation


TheCapn

Recommended Posts

Hello guys,

I'm using an animation when a player talks, but at the end of the animation the player keeps his arms straight long to his body, and move like a robot. I have to "fire" in order to break this freeze.

Do you know how can I fix it ?

Here's my code

  
function sayHandler( message, msgType ) 
 ... 
        setPedAnimation( source, "PED", "IDLE_CHAT", 1, false, true, true, true, false ) 
    ... 
end 
addEventHandler( "onPlayerChat", getRootElement(), sayHandler ) 
  

Link to comment
function sayHandler( message, msgType ) 
 ... 
        local AnimationDuration = 1000   -- Measure your animation's duration in miliseconds 
        setPedAnimation( source, "PED", "IDLE_CHAT", 1, false, true, true, true, false ) 
        setTimer(setPedAnimation,AnimationDuration,1,source) 
    ... 
end 
addEventHandler( "onPlayerChat", getRootElement(), sayHandler ) 

You don't have to use the variable AnimationDuration, I did it just to point it out. Anyway, to stop the player's animation, you use setPedAnimation without specifying animation block and name.

Link to comment

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...