Jump to content

Zombies Slothbot Error?


RekZ

Recommended Posts

debugscript dont give me errors... i donw know why zombies dont spawn :7

    local ZTeam = createTeam( "Zombies" , 255 , 0 , 0) 
      
    function SpawnZombieBot() 
        local Posx,Posy,Posz = getElementPosition (source) 
        local rotation = 0 
        local interior = getElementInterior(source) 
        local dimension = getElementDimension(source) 
        local weapon =  false 
         
        setTeamFriendlyFire( ZTeam ,false) 
         
        for i = 1,10 do 
            local skin = math.random(21,23) 
             
            exports [ "slothbot" ]:spawnBot( Posx,Posy,Posz, rotation , skin, interior, dimension , ZTeam , weapon) 
        end 
    end 
    addEvent("onSpawnSlothBot",true) 
    addEventHandler("onSpawnSlothBot",getRootElement(),SpawnZombieBot) 
      
    function BotZombieDie() 
        if (attacker) then 
            local Posx,Posy,Posz = getElementPosition(attacker) 
            local rotation = 0 
            local interior = getElementInterior(attacker) 
            local dimension = getElementDimension(attacker) 
            local weapon =  false 
            local skin = math.random(21,23) 
             
                exports [ "slothbot" ]:spawnBot( Posx,Posy,Posz, rotation , skin, interior , dimension , ZTeam , weapon) 
                 
        end 
    end 
    addEvent("onBotWasted",true) 
    addEventHandler("onBotWasted",getRootElement(),BotZombieDie) 

Edited by Guest
Link to comment
  • Moderators

You can see this error as:

if 1 == true then -- error 

Probably one of your export data isn't a number.

Maybe:

  
--local weapon =  false 
local weapon =  0 --? 

As far the syntax, when you don't fill in, it starts at 0.

element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = "hunting", element theModesubject = nil ] ) 

Link to comment

now sont give me errors again, but bots doesnt spawn

You can see this error as:
if 1 == true then -- error 

Probably one of your export data isn't a number.

Maybe:

  
--local weapon =  false 
local weapon =  0 --? 

As far the syntax, when you don't fill in, it starts at 0.

element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil, int weapon = 0, string theMode = "hunting", element theModesubject = nil ] ) 

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...