Jump to content

Bots in Teams (Help)


Matiaas97

Recommended Posts

You need this on the serverside

function spawnBot (source)  
   local x,y,z = getElementPosition (source)  
   local rot= 90  
   local skin=13  
   local interior=0  
   local dimension= 0  
   local team=false    -- you need to modifacate this with "your_Team" 
   local weapon=26  
   local mode= "hunting"  -- and modificate this to "following" 
   local modesubject=source  
  
   local slothbot = exports.slothbot  
  
   slothbot:spawnBot(x, y+6, z, rot, skin, interior, dimension, team, weapon, mode, modesubject)  
   slothbot:spawnBot(x, y+7, z, rot, skin+7, interior, dimension, team, weapon, mode, modesubject) 
   slothbot:spawnBot(x, y+8, z, rot, skin+23, interior, dimension, team, weapon, mode, modesubject) 
end  
addCommandHandler("spawnbot", spawnBot) 

Then You can tipe /createbot and 3 bots will be created. But in this code, the will attak you. So you need to get the bot in the same team like you

The misstake is only, if bot shoot at bot. Then the are going to start a fight.

You know need that this bots are not so AI like humans

Link to comment
You need this on the serverside
function spawnBot (source)  
   local x,y,z = getElementPosition (source)  
   local rot= 90  
   local skin=13  
   local interior=0  
   local dimension= 0  
   local team=false    -- you need to modifacate this with "your_Team" 
   local weapon=26  
   local mode= "hunting"  -- and modificate this to "following" 
   local modesubject=source  
  
   local slothbot = exports.slothbot  
  
   slothbot:spawnBot(x, y+6, z, rot, skin, interior, dimension, team, weapon, mode, modesubject)  
   slothbot:spawnBot(x, y+7, z, rot, skin+7, interior, dimension, team, weapon, mode, modesubject) 
   slothbot:spawnBot(x, y+8, z, rot, skin+23, interior, dimension, team, weapon, mode, modesubject) 
end  
addCommandHandler("spawnbot", spawnBot) 

Then You can tipe /createbot and 3 bots will be created. But in this code, the will attak you. So you need to get the bot in the same team like you

The misstake is only, if bot shoot at bot. Then the are going to start a fight.

You know need that this bots are not so AI like humans

Thanks friend, but I'm not a scripter. What have i to do ? Put the text in a new file.lua inside of Slothbot.zip ?

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