try this:
function pedLoad ( name )
local ped = createPed ( 120, 0, 0, 6)
if( ped ) then
local result = setPedOnFire( ped, true )
if( result ) then
outputChatBox("good")
else
outputChatBox("bad2")
end
else
outputChatBox("bad1")
end
end
addEventHandler ( "oncientResourceStart", resourceRoot, pedLoad )