<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Frost+I7</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Frost+I7"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Frost_I7"/>
	<updated>2026-04-21T23:04:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=57985</id>
		<title>Slothman/Slothbot</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Slothman/Slothbot&amp;diff=57985"/>
		<updated>2018-08-12T05:08:42Z</updated>

		<summary type="html">&lt;p&gt;Frost I7: Grammar corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a resource designed to allow scripts or gamemodes to insert a ped into the game that roughly simulates combat with a real player. Gamemodes can implement the bots as opponents to actual players or as teammates. &lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
'''Teamplay:'''&lt;br /&gt;
The bot is capable of identifying friend from foe&lt;br /&gt;
&lt;br /&gt;
'''Map Navigation:'''&lt;br /&gt;
When the bot is placed in a map that has suitable pathways marked out (see below on how to do that) the bot will navigate the map, seeking out enemies. Without pathways, a bot can still think for itself, but wont move around as proficiently.&lt;br /&gt;
&lt;br /&gt;
'''Aggressiveness:'''&lt;br /&gt;
Bots will attack any ped, player or bot that's not on it's team.&lt;br /&gt;
&lt;br /&gt;
'''Cooperation:'''&lt;br /&gt;
Bots can automatically team up with teammates (either player or bot) by meeting up with them and sticking together&lt;br /&gt;
&lt;br /&gt;
'''Advanced movement:'''&lt;br /&gt;
If there's obstacles blocking a bots path, the bot will attempt to get around or over it instead of just walking into a wall for eternity&lt;br /&gt;
&lt;br /&gt;
'''Multiple modes of playing:'''&lt;br /&gt;
*&amp;quot;hunting&amp;quot; - travel pathways until finding an enemy or teammate&lt;br /&gt;
*&amp;quot;waiting&amp;quot; - stand still until an enemy of teammate comes into view&lt;br /&gt;
*&amp;quot;guarding&amp;quot; - the bot will attack any enemy that comes within sight, but not move from its spawn position&lt;br /&gt;
*&amp;quot;following&amp;quot; - the bot will follow a player or bot while attacking enemies&lt;br /&gt;
*&amp;quot;chasing&amp;quot; - the bot will attack an enemy bot or player&lt;br /&gt;
&lt;br /&gt;
'''Gamemode/Script integration:'''&lt;br /&gt;
This script provides several functions and events to allow other resources to see and control what the bot's are doing, and even take control of certain behavior.&lt;br /&gt;
&lt;br /&gt;
'''EDF for map path creation:'''&lt;br /&gt;
Integrated into the map editor, map designers can easily place paths for bots to follow along in their maps. this greatly increased the bots ability to simulate true playing.&lt;br /&gt;
&lt;br /&gt;
=Server Events=&lt;br /&gt;
&lt;br /&gt;
==onBotFindEnemy==&lt;br /&gt;
This triggers when a bot locates an enemy, This event can be cancelled to prevent the bot from chasing players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element enemy&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''enemy''': The Player or Ped the bot has spotted&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that has found an enemy&lt;br /&gt;
&lt;br /&gt;
==onBotWasted==&lt;br /&gt;
This triggers when a bot is killed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element attacker, float weapon, float bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''attacker''': The Element that killed the bot&lt;br /&gt;
*'''weapon''': The weapon id used to kill the bot&lt;br /&gt;
*'''bodypart''': The bodypart id that was hit to kill the bot&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that died&lt;br /&gt;
&lt;br /&gt;
==onBotSpawned==&lt;br /&gt;
This triggers when a bot is spawned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that spawned&lt;br /&gt;
&lt;br /&gt;
==onBotFollow==&lt;br /&gt;
This triggers when a bot starts following a teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Parameters'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element leader&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''leader''': The Player or Ped the bot has started following&lt;br /&gt;
&amp;lt;big&amp;gt;'''Source'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[event system#Event source|source]] of this event is the Bot that starts following a teammate&lt;br /&gt;
&lt;br /&gt;
=Server Functions=&lt;br /&gt;
All of these functions will have to be used through the [[call]] function, otherwise they won't work&lt;br /&gt;
&lt;br /&gt;
==spawnBot==&lt;br /&gt;
This function spawns a bot ingame, will return the bot element, or false if there was a problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
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 = &amp;quot;hunting&amp;quot;, element theModesubject = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''x:''' The x co-ordinate to spawn the bot at&lt;br /&gt;
*'''y:''' The y co-ordinate to spawn the bot at&lt;br /&gt;
*'''z:''' The z co-ordinate to spawn the bot at&lt;br /&gt;
*'''rotation:''' Rotation of the bot on spawn&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''skinID:''' Bots skin on spawn&lt;br /&gt;
*'''interior:''' Interior the bot will spawn into&lt;br /&gt;
*'''dimension:''' The ID of the [[dimension]] that the bot should be in&lt;br /&gt;
*'''theTeam:''' The team the bot will join&lt;br /&gt;
*'''weapon:''' The weapon the ped will carry&lt;br /&gt;
*'''theMode:''' The action the bot will be performing when spawned (see &amp;quot;modes of playing&amp;quot; above)&lt;br /&gt;
*'''theModeSubject:''' If theMode is &amp;quot;chasing&amp;quot; or &amp;quot;following&amp;quot; this arg is needed to tell the bot what opponent to chase or teammate to follow&lt;br /&gt;
&lt;br /&gt;
==setBotHunt==&lt;br /&gt;
makes the bot travel pathways until finding an enemy or teammate&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotHunt ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to hunt&lt;br /&gt;
&lt;br /&gt;
==setBotWait==&lt;br /&gt;
makes the bot stand still until an enemy of teammate comes into view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWait ( element theBot )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to wait&lt;br /&gt;
&lt;br /&gt;
==setBotChase==&lt;br /&gt;
makes the bot attack an anemy bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotChase ( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the chasing&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be chased&lt;br /&gt;
&lt;br /&gt;
==setBotFollow==&lt;br /&gt;
makes the bot follow a teammate bot or player&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotFollow( element theBot, element theTarget )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot that you want to do the following&lt;br /&gt;
*'''theTarget:''' The bot or player you want to be followed&lt;br /&gt;
&lt;br /&gt;
==setBotGuard==&lt;br /&gt;
makes the bot move to the specific coords and stay there while attacking any enemies&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotGuard( element theBot, float x, float y, float z, [ bool priority = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to do the guarding&lt;br /&gt;
*'''x:''' The X coords you want the bot to guard&lt;br /&gt;
*'''y:''' The Y coords you want the bot to guard&lt;br /&gt;
*'''z:''' The Z coords you want the bot to guard&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Optional Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''priority:''' Set to true only if you want the bot to only shoot once it has reached the location to guard&lt;br /&gt;
&lt;br /&gt;
==getBotTeam==&lt;br /&gt;
returns the Team the bot is on, false if no team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotTeam ( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the team of&lt;br /&gt;
&lt;br /&gt;
==setBotTeam==&lt;br /&gt;
changes the bot's team and loyalties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotTeam ( element theBot, team theTeam )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to change the team of&lt;br /&gt;
*'''theTeam:''' The team the bot should join&lt;br /&gt;
&lt;br /&gt;
==getBotAttackEnabled==&lt;br /&gt;
returns true if the bot is allowed to attack, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool getBotAttackEnabled( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check if it can attack&lt;br /&gt;
&lt;br /&gt;
==setBotAttackEnabled==&lt;br /&gt;
allow or disallow the bot to attack (press fire)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotAttackEnabled( element theBot, bool enabled)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set if it can attack&lt;br /&gt;
*'''enabled:''' set to false to remove the bots ability to attack, true to allow it&lt;br /&gt;
&lt;br /&gt;
==getBotMode==&lt;br /&gt;
returns the mode the bot is in (&amp;quot;chasing&amp;quot;, &amp;quot;waiting&amp;quot;, &amp;quot;guarding&amp;quot;, &amp;quot;hunting&amp;quot;, &amp;quot;following&amp;quot;) or if the bot is chasing or following, it will return the mode and the target&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string getBotMode( element theBot)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to check the status of&lt;br /&gt;
&lt;br /&gt;
==isPedBot==&lt;br /&gt;
returns true if the ped is a bot, false otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isPedbot( element thePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''thePed:''' The ped you want to check if its a bot&lt;br /&gt;
&lt;br /&gt;
==setBotWeapon==&lt;br /&gt;
sets the bots weapon id (ammo is always infinite)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Syntax'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setBotWeapon( element theBot, float weapon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Required Arguments'''&amp;lt;/big&amp;gt;&lt;br /&gt;
*'''theBot:''' The bot you want to set the weapon of&lt;br /&gt;
*'''weapon:''' the weapon id you want to give the bot&lt;br /&gt;
&lt;br /&gt;
=Credits=&lt;br /&gt;
*'''Slothman:''' Bot creator, main scripter&lt;br /&gt;
*'''Gamesnert:''' EDF creator, scripting, testing&lt;br /&gt;
*'''Dragon:''' Gamemode creator, testing, scripting help&lt;br /&gt;
*'''EvGeniz:''' early testing, mapping&lt;br /&gt;
'''Thanks to Everyone else who made suggestions, tested the script, helped when i was stuck, etc'''&lt;br /&gt;
[[Category:Resource]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Slothbot]]&lt;/div&gt;</summary>
		<author><name>Frost I7</name></author>
	</entry>
</feed>