Jump to content

Death SepPedAnim HELP


yoya99

Recommended Posts

Posted

hey there where is the error in this code

addEventHandler ( "onPlayerWasted", root, 
    function ( ) 
        setPedAnimation ( source, knife_hit3 ) 
    end 
) 
  

And the snail starts to sing

Posted

setPedAnimation has 3 variables, it also needs to be a string unless it's a variable defined somewhere.

"The humble beet is the answer to all riddles." - Rolf

  • Moderators
Posted

Players cannot make animations while dead.

It is possible, but you have to prevent the player to die.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted
Do how to do it?

Something like this. You can't prevent the dead, but you can prevent dying/getting hurt.

local dataTransferLimiter = false 
addEventHandler("onClientPlayerDamage",localPlayer, 
function (attacker, weapon, bodypart,loss) 
    if not dataTransferLimiter and getElementHealth(source) <= loss then 
        triggerServerEvent("doDeadAnimation",localPlayer) 
        dataTransferLimiter = true 
        cancelEvent() 
    end 
end) 
  
addEventHandler("onClientPlayerSpawn",localPlayer, 
function () 
    dataTransferLimiter = false 
end) 

addEvent("doDeadAnimation",true) 
addEventHandler("doDeadAnimation",root, 
function () 
    if isElement(client) then 
     
    end 
end) 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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