Jump to content

Zombies Slothbot Error?


RekZ

Recommended Posts

Posted (edited)

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

Admin and Owner of the Pro Chile Community :3

Posted

You are spawning one bot when another dies, and the other 10 bots, you want to spawn them when a slothbot spawns.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You can create one when resource start.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted

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 ] ) 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

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 ] ) 

Admin and Owner of the Pro Chile Community :3

  • Moderators
Posted

Well first check which value gives this boolean(true/false)....

I can't help you, if I can't even see the line that went wrong.

After that you should trace this value and find the creation of it.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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