Jump to content

No funca mi slothBot


NodZen

Recommended Posts

Posted

Amigo , hace 1 semana mas o menos hice un slothBot con extra health y todo bien. Pero ahora quise hace que si el elemento NO este , entonces se spawnee el BOT. Miren

function silent ( ) 
if ( not isElement ( piramide ) ) then 
     piramide = exports [ "slothBot" ]:spawnBot ( -2787.1000976563, -1516.1999511719, 139, 90,  math.random ( 200, 203 ), 0, 0, piramid, 8, "hunting", true ) 
     exports [ "extra_health" ]:setElementExtraHealth ( piramide, 2500 ) 
     setElementModel ( piramide, 13) 
         setTimer ( piramide , 3000, 0 ) 
     outputChatBox ("Piramid Head Se ah Generado") 
     local myBlip = (createBlipAttachedTo ( piramide, 8 )) 
    end 
 end 
addEventHandler ( "onResourceStart", getRootElement(), silent ) 

La idea era que cuando el BOT muere , se respawneara a los 3 segundos.

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

setTimer ( piramide , 3000, 0 )

Timer a un elemento? xD. Siempre es a una funcion. Esta funcuion podria contener el exports slothBot spawnBot y el extra health setElementblah

Posted
setTimer ( piramide , 3000, 0 )

Timer a un elemento? xD. Siempre es a una funcion. Esta funcuion podria contener el exports slothBot spawnBot y el extra health setElementblah

Entonces seria asi?

setTimer ( silent, 3000, 0 )--? 

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

Eso spawnearía todo el tiempo cada 3 segundos un slothBot.

Lo que tienes que hacer es poner en el evento de slothBot de la muerte del Bot, colocar ese timer dentro de esa respectiva funcion

Posted
Eso spawnearía todo el tiempo cada 3 segundos un slothBot.

Lo que tienes que hacer es poner en el evento de slothBot de la muerte del Bot, colocar ese timer dentro de esa respectiva funcion

Solo quiero que cuando el BOT muera , se spawnee a los 3 segundos de morir. No more

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

Asi?

function silent ( ) 
if ( not isElement ( piramide ) ) then 
     piramide = exports [ "slothBot" ]:spawnBot ( -2787.1000976563, -1516.1999511719, 139, 90,  math.random ( 200, 203 ), 0, 0, piramid, 8, "hunting", true ) 
     exports [ "extra_health" ]:setElementExtraHealth ( piramide, 2500 ) 
     setElementModel ( piramide, 13) 
         setTimer ( silent , 3000, 0 ) 
     outputChatBox ("Piramid Head Se ah Generado") 
     local myBlip = (createBlipAttachedTo ( piramide, 8 )) 
    end 
 end 
addEvent ( "onBotWasted" ,true ) 
addEventHandler ( "onResourceStart", getRootElement(), silent ) 

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted (edited)
  
function funciondecreaciondelbot() 
    piramide = exports [ "slothBot" ]:spawnBot ( -2787.1000976563, -1516.1999511719, 139, 90,  math.random ( 200, 203 ), 0, 0, piramid, 8, "hunting", true ) 
     exports [ "extra_health" ]:setElementExtraHealth ( piramide, 2500 ) 
     setElementModel ( piramide, 13) 
     outputChatBox("Piramide se ha generado!", getRootElement(), 255, 128, 128, true) 
     local myBlip = (createBlipAttachedTo ( piramide, 8 )) 
end 
  
addEvent("onBotWasted", true) 
addEventHandler("onBotWasted", root, function() 
    if (source == piramide) then 
         setTimer(funciondecreaciondelbot, 3000, 1) 
    local attached = getAttachedElements ( source ) 
    if ( attached ) then 
        for k,element in ipairs(attached) do 
            if getElementType ( element ) == "blip" then 
                destroyElement ( element ) 
            end 
        end 
    end 
    end 
end) 
  
addEventHandler("onResourceStart", resourceRoot, funciondecreaciondelbot) 
  

Edited by Guest
Posted
addEvent("onBotWasted", true) 
addEventHandler("onBotWasted", root, function() 
    if (source == piramide) then 
         setTimer(funciondecreaciondelbot, 3000, 1) 
    end 
end) 

Seria en en mismo script? Perdona mi brutera , es que nunca ese esto. xD

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

  • Recently Browsing   0 members

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