Jump to content

[HELP]setPedAnimation


Padul

Recommended Posts

Posted

Hi,

i start to learn how to script in lua, i start with something easy like creating peds, making them doing animations. I get stuck on start. Ok, so i tried to make ped and make them moving, but, script create peds, make him rotate but, it doesn't make anything, can somebody help mi with this?

function makePed() 
   ped1 = createPed(139, 2039.0611572266, 1543.8338623047, 10.671875) 
   setPedAnimation(ped1,"CRACK","crckidle2") 
end 
addEventHandler( "onResourceStart", getResourceRootElement(),makePed) 

Sorry, for my bad english ;d

MTA Dayz textures and objects: http://padulmods.blogspot.com/

Posted

Use a timer of like 200 milliseconds to set the animation.

setTimer 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

i dont know what i fcked up now but peds are multiplying

  
function makePed() 
    ped1 = createPed(139, 2039.0611572266, 1543.8338623047, 10.671875) 
    setPedAnimation(ped1,"CRACK","crckidle2") 
    setTimer ( makePed, 200, 1)  
end 
addEventHandler( "onResourceStart", getResourceRootElement(),makePed) 
  

MTA Dayz textures and objects: http://padulmods.blogspot.com/

Posted
  
function makePed() 
    ped1 = createPed(139, 2039.0611572266, 1543.8338623047, 10.671875) 
    setTimer(setPedAnimation,200,1,ped1,"CRACK","crckidle2") 
end 
addEventHandler( "onResourceStart", getResourceRootElement(),makePed) 
  

#~BlackBird~#

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