Jump to content

Como usar set timer y algo mas


Hukaeshi

Recommended Posts

Hola, no se como puedo hacer que al momento de que mi boss exportado por slothbot al morir cree una especie de explosion y que vuelva a reaparecer en 1 hora., espero alguien pueda ayudarme gracias.

   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
end
)

 

Edited by Hukaeshi
Link to comment
  • 3 weeks later...
local c1,c2,c3 = getElementPosition( nemesi )

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)
createExplosion( c1, c2, c3, 2)
setTimer(Nemesisbymanawydan, 16000, 1)
end
end
addEvent("onBotWasted", true)
addEventHandler("onBotWasted", getRootElement(), money)

Con algo así debería ser suficiente,

 getElementPosition para obtener las coordenadas donde murió el nemesi

createExplosion para crear la explocion, si lo deseas cambia el 2 por cualquier otro tipo de explocion disponible: 

  • 0: Grenade
  • 1: Molotov
  • 2: Rocket
  • 3: Rocket Weak
  • 4: Car
  • 5: Car Quick
  • 6: Boat
  • 7: Heli
  • 8: Mine
  • 9: Object
  • 10: Tank Grenade
  • 11: Small
  • 12: Tiny
Link to comment
  • 1 month later...

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