Plate Posted August 4, 2012 Posted August 4, 2012 Hola tengo un problema con el destroyElement me dice badArgument function destroyblip() destroyElement( myBlip ) end addEventHandler("onBotWasted",getRootElement(),destroyblip)
Plate Posted August 4, 2012 Author Posted August 4, 2012 local myBlip = createBlipAttachedTo ( slothbot1, 23 ) Si
Plate Posted August 4, 2012 Author Posted August 4, 2012 local colshape = createColCuboid ( 103.88594818115, 1302.0729980469, 10.5859375, 220, 200, 60 ) zombiesMatados = 0 function zona ( ) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = ( zombiesMatados + 1 ) if ( zombiesMatados == 1 ) then if ( not isElement ( slothbot1 ) ) then slothbot1 = exports [ "slothbot" ]:spawnBot ( 111.79273223877, 1336.3046875, 10.5859375, 90, math.random ( 300, 303 ), 0, 0, ex, 38, "hunting", true ) exports.extra_health:setElementExtraHealth ( slothbot1, 100 ) outputChatBox("Boss spawned", getRootElement(), 155, 155, 155) onZomieWasted = 1 local myBlip = createBlipAttachedTo ( slothbot1, 23 ) end end end end addEvent ( "onZombieWasted", true ) function destroyblip() destroyElement(myBlip) end addEventHandler("onBotWasted",getRootElement(),destroyblip)
Castillo Posted August 4, 2012 Posted August 4, 2012 Como lo suponia, hiciste local a la variable "myBlip". local colshape = createColCuboid ( 103.88594818115, 1302.0729980469, 10.5859375, 220, 200, 60 ) zombiesMatados = 0 function zona ( ) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = ( zombiesMatados + 1 ) if ( zombiesMatados == 1 ) then if ( not isElement ( slothbot1 ) ) then slothbot1 = exports [ "slothbot" ]:spawnBot ( 111.79273223877, 1336.3046875, 10.5859375, 90, math.random ( 300, 303 ), 0, 0, ex, 38, "hunting", true ) exports.extra_health:setElementExtraHealth ( slothbot1, 100 ) outputChatBox("Boss spawned", getRootElement(), 155, 155, 155) onZomieWasted = 1 myBlip = createBlipAttachedTo ( slothbot1, 23 ) end end end end addEvent ( "onZombieWasted", true )
Plate Posted August 4, 2012 Author Posted August 4, 2012 Funciona gracias solid otra cosa como puedo hacer para que en el colshape enves de qe tenga solamente esa posicion z tenga todas
Castillo Posted August 4, 2012 Posted August 4, 2012 Si el colshape tiene que ser un rectangulo, usa createColRectangle.
Plate Posted August 4, 2012 Author Posted August 4, 2012 local colshape = createColRectangle ( 103.88594818115, 1302.0729980469, 220, 200, 60 ) -- hay?
Recommended Posts