Jump to content

Animations on spawn HELP


Recommended Posts

So i have this code, and this code work great, but when i will die and i will respawn i have still animations even if my ID skin is not 78 or 76 so what i need add there that will set my player animation on 0 when im respawning? 

 

function informPlayerOnModelChange(oldModel, newModel)
    if ( getElementType(source) == "player" ) then 
        skin = getPedSkin(localPlayer)
        if skin == 78 or skin == 76 then
            setPedWalkingStyle(localPlayer,59) 
        else 
            setPedWalkingStyle(localPlayer,0) 
        end 
    end return
end
addEventHandler("onClientElementModelChange", root, informPlayerOnModelChange)

 

Edited by LOOah
Link to comment
4 hours ago, LOOah said:

So i have this code, and this code work great, but when i will die and i will respawn i have still animations even if my ID skin is not 78 or 76 so what i need add there that will set my player animation on 0 when im respawning? 

 


function informPlayerOnModelChange(oldModel, newModel)
    if ( getElementType(source) == "player" ) then 
        skin = getPedSkin(localPlayer)
        if skin == 78 or skin == 76 then
            setPedWalkingStyle(localPlayer,59) 
        else 
            setPedWalkingStyle(localPlayer,0) 
        end 
    end return
end
addEventHandler("onClientElementModelChange", root, informPlayerOnModelChange)

 

Change getPedSkin to getElementModel

 

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