Hukaeshi

como crear explosión

Recommended Posts

Hola mi problema es que no puedo usar la funcion de createexplosion, quiero que cuando muera mi bot, aparesca una explosion.

 

  local hillRadar = createRadarArea ( 1666.548828125, -1057.265625, 0, 0, 0, 0, 0, 255 )
            function Nemesisbymanawydan ( )  
                   nemesi = exports [ "slothBot" ]:spawnBot ( 1666.548828125, -1057.265625, 23.8984375, 90,  math.random ( 300, 303 ), 0, 0, Nemesis, 34, "hunting", true )
                  setElementModel ( nemesi, 310 )
				  outputChatBox ("#FF0000BOSS: #00FF22El Boss Sniper ha vuelto a la vida. en la Ciudad #FF0000 Los Santos",getRootElement(), 255, 255, 255, true )
                  outputChatBox ("#F7FF00$15.000 como recompenza al matarlo!",getRootElement(), 255, 255, 255, true )
                  local myBlip = (createBlipAttachedTo ( nemesi, 23 ))
                  attachElements ( baz, nemesi, 0.2, 0.1, 0.5, 0, 90, 0 )
                  triggerClientEvent ( "nsound", root )
				  setElementData(Nemesisbymanawydan, "nemesi",true)
                 setTimer(
                  function()
                  exports.extra_health:setElementExtraHealth(nemesi, 500)
                  end, 100, 100)
             end
            addEventHandler("onResourceStart", resourceRoot, Nemesisbymanawydan)  
           addEvent("onBotWasted", true)
        addEventHandler("onBotWasted", getRootElement)  
 
function money (theKiller)
if (source == nemesi) then
givePlayerMoney(theKiller,math.random(1500))
outputChatBox("#FF0000BOSS: #F7FF00".. getPlayerName ( theKiller ) .." #00FF22ha matado al #FF0000Boss Sniper, #00FF22ha ganado $15.000 como recompenza.",player,255, 255, 255, true) 
setTimer(Nemesisbymanawydan, 16000, 1)
end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), money)
     
addEvent("onBotWasted",true)
addEventHandler("onBotWasted",getRootElement(),
function ()
if (source == nemesi) then
destroyElement(myBlip)
end

 

Share this post


Link to post

Prueba con reemplazar las líneas 30 a la 35 con esto:

addEventHandler("onBotWasted", root,
  function ()
    if (source == nemesi) then
      local x, y, z = getElementPosition(source)
      createExplosion(x, y, z, 9)
      destroyElement(myBlip)
    end
  end
)

 

Edited by Alexs

Share this post


Link to post

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.