Jump to content

Problema con destroyElement


Plate

Recommended Posts

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

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
  • Recently Browsing   0 members

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