<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.teamspec.net/index.php?action=history&amp;feed=atom&amp;title=Level_Editor%2FScripting%2FReference%2FGamemodeBotScript</id>
	<title>Level Editor/Scripting/Reference/GamemodeBotScript - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.teamspec.net/index.php?action=history&amp;feed=atom&amp;title=Level_Editor%2FScripting%2FReference%2FGamemodeBotScript"/>
	<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeBotScript&amp;action=history"/>
	<updated>2026-10-28T07:03:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeBotScript&amp;diff=508&amp;oldid=prev</id>
		<title>TeamSpecBot: American spelling</title>
		<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeBotScript&amp;diff=508&amp;oldid=prev"/>
		<updated>2026-10-20T04:46:12Z</updated>

		<summary type="html">&lt;p&gt;American spelling&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:46, 20 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l102&quot;&gt;Line 102:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 102:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;attacker&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;attacker&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|description=A boss took damage, after the server script heard about it. Rebalance the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;defence &lt;/del&gt;here: &amp;lt;code&amp;gt;api.entity_health&amp;lt;/code&amp;gt; reads what it has left.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|description=A boss took damage, after the server script heard about it. Rebalance the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;defense &lt;/ins&gt;here: &amp;lt;code&amp;gt;api.entity_health&amp;lt;/code&amp;gt; reads what it has left.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-115:rev-508:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>TeamSpecBot</name></author>
	</entry>
	<entry>
		<id>https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeBotScript&amp;diff=115&amp;oldid=prev</id>
		<title>TeamSpecBot: Scripting reference: GamemodeBotScript</title>
		<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeBotScript&amp;diff=115&amp;oldid=prev"/>
		<updated>2026-10-20T03:48:28Z</updated>

		<summary type="html">&lt;p&gt;Scripting reference: GamemodeBotScript&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The base class of &amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;: the script starts with &amp;lt;code&amp;gt;extends GamemodeBotScript&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The base class of a map&amp;amp;#39;s &amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;: what the mode tells its bots to do.&lt;br /&gt;
&lt;br /&gt;
This script runs on the server next to &amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt; and works through the very same &amp;lt;code&amp;gt;api&amp;lt;/code&amp;gt;, so it sees exactly the match the rules are running. Give bots their jobs here and keep the rules in &amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;: a point scored from this file is a rule nobody will find.&lt;br /&gt;
&lt;br /&gt;
A bot is told its job, never its movement. With no orders it hunts whoever is nearest and wanders when there is nobody.&lt;br /&gt;
&lt;br /&gt;
See [[Level Editor/Scripting/Reference]] for every class, and [[Level Editor/Scripting/Reference/Sandbox]] for the rest of GDScript a script may use.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== api ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=api&lt;br /&gt;
|kind=Property&lt;br /&gt;
|signature=api: GamemodeServerApi&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=Everything this script can do goes through &amp;lt;code&amp;gt;api&amp;lt;/code&amp;gt;. See [[Level Editor/Scripting/Reference/GamemodeServerApi|GamemodeServerApi]].&lt;br /&gt;
&lt;br /&gt;
Everything this script can do: the server script&amp;amp;#39;s own &amp;lt;code&amp;gt;GamemodeServerApi&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Hooks ==&lt;br /&gt;
&lt;br /&gt;
=== _start ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_start&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_start() -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=The map is live, and the server script&amp;amp;#39;s &amp;lt;code&amp;gt;_start&amp;lt;/code&amp;gt; has already run. Look up the zones and positions your orders use here, once.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _tick ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_tick&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_tick(_delta: float) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=Every server tick, after the rules have run for that tick. Orders do not expire and giving the same order again costs nothing, so decide every bot&amp;amp;#39;s job on an interval and give it every time.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _player_joined ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_player_joined&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_player_joined(_entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;entity_id&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=A player joined, after the server script gave them a team. &amp;lt;code&amp;gt;api.is_bot&amp;lt;/code&amp;gt; says whether it is a bot; this is the place for &amp;lt;code&amp;gt;api.bot_set_skill&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _player_spawned ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_player_spawned&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_player_spawned(_entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;entity_id&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=A player came back to life after dying. Not called for the first spawn after joining; that is &amp;lt;code&amp;gt;_player_joined&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _player_died ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_player_died&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_player_died(_entity_id: int, _killer_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;entity_id&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;killer_id&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=A player died. Drop whatever you were tracking about them. When they respawn is the server script&amp;amp;#39;s decision, so there is no respawn time here.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _player_left ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_player_left&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_player_left(_entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;entity_id&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=A player left the match for good. Forget anything you kept about them.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _entity_damaged ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_entity_damaged&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_entity_damaged(_entity: int, _amount: float, _attacker: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;attacker&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=A boss took damage, after the server script heard about it. Rebalance the defence here: &amp;lt;code&amp;gt;api.entity_health&amp;lt;/code&amp;gt; reads what it has left.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _entity_died ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_entity_died&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_entity_died(_entity: int, _killer: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;bot.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;killer&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
|returns=&amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=A boss died, after the server script heard about it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Gamemode scripting]]&lt;br /&gt;
[[Category:Scripting reference]]&lt;br /&gt;
&lt;br /&gt;
{{Level Editor nav}}&lt;/div&gt;</summary>
		<author><name>TeamSpecBot</name></author>
	</entry>
</feed>