Jump to content

[ help ] spawnBot - onMakerHit - setTimer


Cocodrilo

Recommended Posts

Hi everyone,

How to make to spawn a bot when i hit a maker?

This is my code but even I can't see the marker :( What is wrong?

  
local coco = createMarker(  -5894.84375, 1705.669921875, 190.88436889648, "Cylinder", 3, 143, 7, 49, 255) 
  
     
  
 function MarkerHit( hitElement, matchingDimension ) 
                  local elementType = getElementType( hitElement ) 
                  local account = getPlayerAccount( hitElement )                   
                  local zombiekills = getAccountData(account,"Zombie kills") 
                  if (zombiekills <= 100000)  then               
                  local skin = 155 
        slothbot1 = exports [ "slothbot" ]:spawnBot ( 168.3, 1409.7, 10.6, 90, skin, 0, 0, ex, 38, "hunting", true ) 
 local id = getElementModel ( slothbot1 ) 
 if id == 155 then 
        exports.extra_health:setElementExtraHealth(slothbot1, 1000) 
        outputChatBox("The Boss 1 has spawned !!!", getRootElement(), 255, 0, 0) 
        myBlip = createBlipAttachedTo ( slothbot1, 23 ) 
           end 
         end 
      end 
    
  
        addEventHandler( "onMarkerHit", coco, MarkerHit ) 

Edited by Guest
Link to comment
local coco = createMarker(  -5894.84375, 1705.669921875, 190.88436889648, "Cylinder", 3, 143, 7, 49, 255) 
  
function MarkerHit( hitElement, matchingDimension ) 
  local elementType = getElementType( hitElement ) 
  local account = getPlayerAccount( hitElement )                  
  local zombiekills = getAccountData(account,"Zombie kills") 
    if (zombiekills <= 100000)  then              
      local skin = 155 
      setTimer( function() 
        slothbot1 = exports [ "slothbot" ]:spawnBot ( 168.3, 1409.7, 10.6, 90, skin, 0, 0, ex, 38, "hunting", true ) 
        local id = getElementModel ( slothbot1 ) 
        if id == 155 then 
          exports.extra_health:setElementExtraHealth(slothbot1, 1000) 
          outputChatBox("The Boss 1 has spawned !!!", getRootElement(), 255, 0, 0) 
          myBlip = createBlipAttachedTo ( slothbot1, 23 ) 
        end 
      end, 10000, 1 ) 
    end 
end 
addEventHandler( "onMarkerHit", coco, MarkerHit ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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