Jump to content

[Ayuda] BOSS Respawn


Recommended Posts

Hola lo que pasa es que una vez que muere no spawnea de nuevo :/ algun error?

solo spawnea 1 vez y luego nada :/ me dice un error de "isElementWithinColShape "

----BOSS 
  
local colshape = createColRectangle ( -2960, -2960, 5920, 5920 ) -- estas son las coordenadas donde se va a crear el boss para cambiarlas solamente copien la posicion x e y de su admin panel 
local zombiesMatados = 0 
  
local weapons = 
    { 
        [ 33 ] = 38, 
       
    } 
  
function zona (attacker, weapon, bodypart) 
 if ( isElementWithinColShape ( source, colshape ) ) then 
  zombiesMatados = ( zombiesMatados + 1 ) 
  if ( zombiesMatados == 100 ) then --Numero de Zombis por Matar 
   if ( not isElement ( slothbot1 ) ) then 
    local x, y, z = getElementPosition(attacker) 
    local skin = math.random ( 33, 35 ) 
    local vida = exports.extra_health:getElementExtraHealth(slothbot1) 
    slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z+3, 90, skin, 0, 0, false, weapons [ skin ] or 0, "hunting" )  
   if slothbot1 then 
   triggerClientEvent("spawneo", getRootElement()) 
    myBlip = createBlipAttachedTo ( slothbot1, 23 ) 
   setElementData(slothbot1, "Witch", true) 
    local id = getElementModel ( slothbot1 ) 
    if id == 33 then 
        exports.extra_health:setElementExtraHealth(slothbot1, 30000) 
        setElementData(slothbot1, "Witch", true) 
         
        outputChatBox ( "#ff0000Nemesis: #eeff00S.T.A.R.S!!!", getRootElement(), 255, 255, 255, true) 
    elseif id == 34 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 100000) 
     
        outputChatBox ( "#ff0000Tyrant a Spawneado, Corre!", getRootElement(), 255, 255, 255, true) 
    elseif id == 35 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 400000) 
      
     
     outputChatBox("Lincker a Spawneado...", getRootElement(), 155, 155, 155, false) 
    
                         end 
                         setElementData( slothbot1, "currenthealth", exports.extra_health:getElementExtraHealth( slothbot1 ) ) 
                     end 
                end 
           end 
      end 
end 
addEventHandler ( "onZombieWasted", getRootElement(), zona ) 
  
  
  
  
  
---RepawnBots 
function restartear ( ) 
     
zombiesMatados = 0 
  
   
end 
  
addEvent ( "onBotWasted", true ) 
  
  
function repa () 
setTimer( restartear, 5000, 1 ) 
end 
addEventHandler ( "onBotWasted",getRootElement(), repa ) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...