Jump to content

Zombies sistem = Slothbot ?


Darky

Recommended Posts

how i can create a Zombie sistem whit Slothbot ? i do this but bot dont spawn ._.

  
zombiesTeam = createTeam ("Zombies", 255 , 0 , 0) 
function zombieSistem( ) 
       x,y,z = getElementPosition( source) 
       zombie1 = exports [ "slothBot" ]:spawnBot ( x+5,y+5,z+0.5 , 0, 46, 0, 0, zombiesTeam , 0, "hunting", true ) 
  
addEventHandler ( "onResourceStart", getRootElement(), zombieSistem) 

Link to comment

You have to use :

getElementsByType 

And loop the players :

And you're script should be :

-- # Server Side 
local zombiesTeam = createTeam ("Zombies", 255 , 0 , 0) 
function zombieSistem( ) 
    for i,player in ipairs ( getElementsByType ( "player" ) ) do 
       x,y,z = getElementPosition( player ) 
       zombie1 = exports [ "slothBot" ]:spawnBot( x+5,y+5,z+0.5 , 0, 46, 0, 0, zombiesTeam , 0, "hunting", true ) 
    end 
end 
addEventHandler ("onResourceStart",resourceRoot, zombieSistem) 

This script will get all players and export the function

Link to comment
onResourceStart has no player element, so source is invalid.

mmm , I didnt know that thx

You have to use :

getElementsByType 

And loop the players :

And you're script should be :

-- # Server Side 
local zombiesTeam = createTeam ("Zombies", 255 , 0 , 0) 
function zombieSistem( ) 
    for i,player in ipairs ( getElementsByType ( "player" ) ) do 
       x,y,z = getElementPosition( player ) 
       zombie1 = exports [ "slothBot" ]:spawnBot( x+5,y+5,z+0.5 , 0, 46, 0, 0, zombiesTeam , 0, "hunting", true ) 
    end 
end 
addEventHandler ("onResourceStart",resourceRoot, zombieSistem) 

This script will get all players and export the function

i think i can do the respawn bot whit onBotWasted ?

addEvent("onBotWasted",true) 
addEventHandler ("onBotWasted",resourceRoot, lol) 

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