Jump to content

Help- Ped Animation [Solved]


Mateo_Strahm

Recommended Posts

I write this script but when I start server and write command /peds, ped doesn't create...please tell me where is code wrong

function makePed() 
    local ped1 = createPed(299, -1629, -167.89999389648, 17.60000038147) 
    setPedAnimation( ped1, "DANCING", "dnce_M_c") 
end 
addCommandHandler ( "peds", makeped ) 

Edited by Guest
Link to comment

You should try the command debugscript 3 to see every error that Lua interface will report you. This going to help us (and you) to find the mistake.

I bet that you should write "makeped" exactly how is your function name is (with uppercase in P), because addCommandHandler is case sensitive by default. So the correct is:

function makePed() 
    local ped1 = createPed(299, -1629, -167.89999389648, 17.60000038147) 
    setPedAnimation( ped1, "DANCING", "dnce_M_c") 
end 
addCommandHandler ( "peds", makePed ) 
  

Link to comment
function makePed ( ) 
    local ped1 = createPed(299, -1629, -167.89999389648, 17.60000038147) 
    setPedAnimation( ped1, "DANCING", "dnce_M_c",-1,true,false,false) 
    if ( ped1 ) then 
        outputChatBox ( "PED WAS CREATED!" ) 
    end 
end 
addCommandHandler ( "peds", makePed ) 

Try that and see if it says "PED WAS CREATED" on your chat.

Link to comment

Are you sure that the resource is actually started? see if this says that it was executed:

function makePed ( ) 
    outputChatBox ( "Command executed!" ) 
    local ped1 = createPed(299, -1629, -167.89999389648, 17.60000038147) 
    setPedAnimation( ped1, "DANCING", "dnce_M_c",-1,true,false,false) 
end 
addCommandHandler ( "peds", makePed ) 

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