Jump to content

[BOSS] Spawn


Narutimmy

Recommended Posts

Hola, lo que pasa es que ya e usado y editado varios diferentes, desde que cada cierto tiempo spawne en cordenadas aleatorias de una tabla. Tambien que al entrar a una Area al matar Cierta cantidad de zombis Spawne, pero lo que yo quiero es que spawnee en ciertos lugares pero en lugar de cierto tiempo pero cuando aya cierta concentracion de personas.

Pense en crear varias coldshare creo se llaman que abarquen todo el mapa como estilo... un tablero de ajedres y que de igual manera al matar muchos zombis spawnee... pero es mas laborioso creo yo.

Que me aconsejan?

Link to comment

Al final quedo asi

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 
zombiesMatados = 0 
function zona (attacker, weapon, bodypart) 
 if ( isElementWithinColShape ( source, colshape ) ) then 
  zombiesMatados = ( zombiesMatados + 1 ) 
  if ( zombiesMatados == 10 ) then --Numero de Zombis por Matar 
   if ( not isElement ( slothbot1 ) ) then 
    local x, y, z = getElementPosition(attacker) 
    slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z, 90, math.random(33, 35), 0, 0, ex, 38, "hunting", true ) 
    myBlip = createBlipAttachedTo ( slothbot1, 23 ) 
    local id = getElementModel ( slothbot1 ) 
    if id == 33 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 10000) 
     outputChatBox("[bOSS]:Boss medium spawned", getRootElement(), 155, 155, 155, false) 
      
     elseif id == 34 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 50000) 
     outputChatBox("[bOSS]:Boss high spawned", getRootElement(), 155, 155, 155, false) 
    elseif id == 35 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 5000) 
     outputChatBox("[bOSS]:Boss low spawned", getRootElement(), 155, 155, 155, false) 
    end 
            end 
        end 
    end 
end 
addEventHandler ( "onZombieWasted", getRootElement(), zona ) 
addEventHandler("onBotSpawn",getRootElement(),zona) 

el problema es que quiero que tengan distintas armas y paguen diferente exp y dinero

Link to comment
addEventHandler ( "onBotWasted", root, 
    function ( theKiller ) 
model = getElemntModel(slothbot1) -- slothbot 1 cambialo 
if model == 300 then 
        exports.exp_system:addPlayerEXP ( theKiller, 5000 ) 
                givePlayerMoney(theKiller, 5000) 
elseif model == 301 then 
                exports.exp_system:addPlayerEXP(theKiller, 2500) 
                givePlayerMoney(theKiller, 2500) 
elseif model == 302 then 
                exports.exp_system:addPlayerEXP(theKiler, 1000) 
                givePlayerMoney(theKiller, 1000) 
   end 
end 
) 
  
  

eso es para dar exp y plata despues para las armas usa giveWeapon

Link to comment
addEventHandler ( "onBotWasted", root, 
    function ( theKiller ) 
model = getElemntModel(slothbot1) -- slothbot 1 cambialo 
if model == 300 then 
        exports.exp_system:addPlayerEXP ( theKiller, 5000 ) 
                givePlayerMoney(theKiller, 5000) 
elseif model == 301 then 
                exports.exp_system:addPlayerEXP(theKiller, 2500) 
                givePlayerMoney(theKiller, 2500) 
elseif model == 302 then 
                exports.exp_system:addPlayerEXP(theKiler, 1000) 
                givePlayerMoney(theKiller, 1000) 
   end 
end 
) 
  
  

eso es para dar exp y plata despues para las armas usa giveWeapon

Asi?

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 
zombiesMatados = 0 
function zona (attacker, weapon, bodypart) 
 if ( isElementWithinColShape ( source, colshape ) ) then 
  zombiesMatados = ( zombiesMatados + 1 ) 
  if ( zombiesMatados == 10 ) then --Numero de Zombis por Matar 
   if ( not isElement ( slothbot1 ) ) then 
    local x, y, z = getElementPosition(attacker) 
    slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z+3, 90, math.random(33, 35), 0, 0, ex, 0, "hunting", true ) 
    myBlip = createBlipAttachedTo ( slothbot1, 23 ) 
    local id = getElementModel ( slothbot1 ) 
    if id == 33 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 10000) 
     giveWeapon( slothbot1, 38, 9999, true ) 
     outputChatBox("[bOSS]:Boss medium spawned", getRootElement(), 155, 155, 155, false) 
    elseif id == 34 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 50000) 
     outputChatBox("[bOSS]:Boss high spawned", getRootElement(), 155, 155, 155, false) 
    elseif id == 35 then 
     exports.extra_health:setElementExtraHealth(slothbot1, 5000) 
     giveWeapon( slothbot1, 8, 1, true ) 
     outputChatBox("[bOSS]:Boss low spawned", getRootElement(), 155, 155, 155, false) 
    end 
            end 
        end 
    end 
end 
addEventHandler ( "onZombieWasted", getRootElement(), zona ) 
addEventHandler("onBotSpawn",getRootElement(),zona) 

Link to comment
Comproba la vida del bot
function vida() 
local vida = exports.extra_health:getElementExtraHealth(slothbot1) -- acordate de cambiar esto de slothbot1  
outputChatBox("la vida del boss es ".. vida.."", 255, 0, 255) 
end 
addCommandHanlder("lavida", vida) 

addCommandHandler*

Link to comment
  • Recently Browsing   0 members

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