Plate Posted August 4, 2012 Share Posted August 4, 2012 Hola tengo un problema con el destroyElement me dice badArgument function destroyblip() destroyElement( myBlip ) end addEventHandler("onBotWasted",getRootElement(),destroyblip) Link to comment
Arsilex Posted August 4, 2012 Share Posted August 4, 2012 estas seguro que tu Blip se llama myBlip? Link to comment
Plate Posted August 4, 2012 Author Share Posted August 4, 2012 local myBlip = createBlipAttachedTo ( slothbot1, 23 ) Si Link to comment
Castillo Posted August 4, 2012 Share Posted August 4, 2012 Postea el script entero, faltan cosas. Link to comment
Plate Posted August 4, 2012 Author Share 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) Link to comment
Castillo Posted August 4, 2012 Share 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 ) Link to comment
Plate Posted August 4, 2012 Author Share 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 Link to comment
Castillo Posted August 4, 2012 Share Posted August 4, 2012 Si el colshape tiene que ser un rectangulo, usa createColRectangle. Link to comment
Plate Posted August 4, 2012 Author Share Posted August 4, 2012 local colshape = createColRectangle ( 103.88594818115, 1302.0729980469, 220, 200, 60 ) -- hay? Link to comment
Recommended Posts