Jump to content

Random ped dancing


Recommended Posts

Hello guys,whats the problem? There is no debug error.

local randomAnim = 
{
"bd_clap",
"bd_clap1",
"dance_loop",
"dan_down_a",
"dan_left_a",
"dan_loop_a",
"dan_right_a",
"dan_up_a",
"dnce_m_a",
"dnce_m_b",
"dnce_m_c",
"dnce_m_d",
"dnce_m_e",
}


local ped = createPed(47,2083.7927246094, 1449.6617431641, 10.8203125)
setElementData(ped,"ped:Id",1)
setPedAnimation(ped,"DANCING",randomAnim[math.random(#randomAnim)])
setElementFrozen(ped,true) 

 

Link to comment

I had that problem to. There is my way to fix this issue:

kurisu = createPed (39, 359.71392822266, 173.66009521484, 1010.3893432617, -90)
addEventHandler("onResourceStart", getRootElement(), function ()
    setTimer(function ()
        kurisuDance = setPedAnimation(kurisu, "dancing", "dnce_m_e", -1, true, false, false, false)
    end, 100, 1)
    end)

Yes, yes. Let server to rest a bit after spawning ped.

Edited by f8upd8
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...