<?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%2FGamemodeServerScript</id>
	<title>Level Editor/Scripting/Reference/GamemodeServerScript - 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%2FGamemodeServerScript"/>
	<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeServerScript&amp;action=history"/>
	<updated>2026-10-28T05:41:08Z</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/GamemodeServerScript&amp;diff=119&amp;oldid=prev</id>
		<title>TeamSpecBot: Scripting reference: GamemodeServerScript</title>
		<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeServerScript&amp;diff=119&amp;oldid=prev"/>
		<updated>2026-10-20T03:48:31Z</updated>

		<summary type="html">&lt;p&gt;Scripting reference: GamemodeServerScript&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;server.gd&amp;lt;/code&amp;gt;: the script starts with &amp;lt;code&amp;gt;extends GamemodeServerScript&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;server.gd&amp;lt;/code&amp;gt;: the rules of its gamemode.&lt;br /&gt;
&lt;br /&gt;
Override the hooks your mode needs and leave the rest; each one already does something sensible. Everything the script can do goes through &amp;lt;code&amp;gt;api&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This script runs only on the server, so it is the one place that can change the match: counters, teams, respawns, pickups and the winner.&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;server.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, as a &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;
=== _declare ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_declare&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_declare() -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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=Declare every counter and team the mode uses. Runs once, before anything else, and is the only place declarations work.&lt;br /&gt;
}}&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;server.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. Set up the round here. The level&amp;amp;#39;s supply packs are already out.&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;server.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. Give them a team here with &amp;lt;code&amp;gt;api.set_team_of&amp;lt;/code&amp;gt;; the default puts them on the smallest team. Once this returns, the game places them at &amp;lt;code&amp;gt;_spawn_position&amp;lt;/code&amp;gt;. Their first spawn is observed here: &amp;lt;code&amp;gt;_player_spawned&amp;lt;/code&amp;gt; runs only when they come back after dying.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _assign_to_smaller_team ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_assign_to_smaller_team&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_assign_to_smaller_team(entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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=Puts the player with their Steam party when it is already playing and its team has room, otherwise on whichever declared team has the fewest players, the lowest team on a tie. A player who already has a team is left where they are. Call it from your own &amp;lt;code&amp;gt;_player_joined&amp;lt;/code&amp;gt; to keep the default for some players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _can_join_team ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_can_join_team&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_can_join_team(_entity_id: int, _team: int) -&amp;amp;gt; bool&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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;team&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;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=May this player change to this team? Return false to refuse. Asked only after the game has checked that the team exists and is not full. The default allows everything.&lt;br /&gt;
&lt;br /&gt;
Not asked when a player leaves to spectate: that is always allowed.&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;server.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, at the position &amp;lt;code&amp;gt;_spawn_position&amp;lt;/code&amp;gt; chose. 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, _default_seconds: float) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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;
* &amp;lt;code&amp;gt;default_seconds&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=A player died. They stay dead until you call &amp;lt;code&amp;gt;api.respawn_in&amp;lt;/code&amp;gt;: pass &amp;lt;code&amp;gt;default_seconds&amp;lt;/code&amp;gt;, the player&amp;amp;#39;s normal respawn time, or a different number, or nothing at all for an elimination round.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;killer_id&amp;lt;/code&amp;gt; is the player who gets the kill, or -1 when nobody earned it. &amp;lt;code&amp;gt;api.death_position()&amp;lt;/code&amp;gt; is where they died.&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;server.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;
=== _spawn_position ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_spawn_position&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_spawn_position(entity_id: int) -&amp;amp;gt; Vector3&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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;Vector3&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=Where this player should appear, on joining and on every respawn. The default picks one of their team&amp;amp;#39;s spawn points at random.&lt;br /&gt;
&lt;br /&gt;
Runs while the player is being placed, apart from the other hooks: only read through &amp;lt;code&amp;gt;api&amp;lt;/code&amp;gt; here, change nothing, and always return a position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _zone_entered ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_zone_entered&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_zone_entered(_zone: StringName, _entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;zone&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &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 living player walked into a zone. Compare &amp;lt;code&amp;gt;api.zone_label(zone)&amp;lt;/code&amp;gt; with the name you gave it in the editor.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _zone_exited ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_zone_exited&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_zone_exited(_zone: StringName, _entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;zone&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &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 is no longer in a zone: they walked out, died or left the match. Do not assume they are alive somewhere else.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _zone_used ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_zone_used&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_zone_used(_zone: StringName, _entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;zone&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &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 standing in a usable zone pressed the use key. A zone is usable when its Area Trigger has a Use Prompt, which the HUD shows to anyone inside it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _form_submitted ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_form_submitted&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_form_submitted(_entity_id: int, _form: StringName, _values: PackedInt32Array) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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;form&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;values&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;PackedInt32Array&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 applied a tile map you opened on them with &amp;lt;code&amp;gt;api.open_tile_map&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;form&amp;lt;/code&amp;gt; is the name you gave it, and &amp;lt;code&amp;gt;values&amp;lt;/code&amp;gt; holds one option index per tile, in the order you sent them. The game has already checked that the answer fits the map you sent, but a player can apply the same map again, so make applying it twice harmless.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _left_world ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_left_world&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_left_world(entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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 fell out of the world: they went below the map&amp;amp;#39;s World Boundary. The default kills them, with nobody credited. Override it to do something else, such as putting them back.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _zone_tick ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_zone_tick&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_zone_tick(_zone: StringName, _occupants: Array, _delta: float) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;zone&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;occupants&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt;&lt;br /&gt;
* &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, for every zone, including empty ones, so a capture meter can drain when nobody is on the point. &amp;lt;code&amp;gt;occupants&amp;lt;/code&amp;gt; are the living players inside, sorted. &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; is the seconds since the last tick.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _track_marker ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_track_marker&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_track_marker(_track: StringName, _marker: StringName, _forward: bool) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;marker&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;forward&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;bool&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 cart on &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt; passed one of its markers (see &amp;lt;code&amp;gt;api.track_markers&amp;lt;/code&amp;gt;). &amp;lt;code&amp;gt;forward&amp;lt;/code&amp;gt; is true when it reached the marker going forward, and false when it rolled back past it. A cart standing exactly on a marker has reached it. Several markers passed in one tick arrive in the order the cart passed them. Called before &amp;lt;code&amp;gt;_tick&amp;lt;/code&amp;gt;, so &amp;lt;code&amp;gt;_tick&amp;lt;/code&amp;gt; already sees what you set here. A marker the cart starts the round on or behind is not passed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _can_collect ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_can_collect&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_can_collect(_handle: int, _entity_id: int) -&amp;amp;gt; bool&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;handle&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &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;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=May this player take this pickup? Return false to refuse. Asked when they come close enough, and again when it reaches them. The default lets anybody take anything.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _pickup_collected ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_pickup_collected&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_pickup_collected(_handle: int, _entity_id: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;handle&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &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 took a pickup. The handle still answers &amp;lt;code&amp;gt;api.pickup_kind&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;api.pickup_team&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api.pickup_position&amp;lt;/code&amp;gt; during this hook; afterwards it is gone. Health and ammo packs refill the player by themselves.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _pickup_expired ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_pickup_expired&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_pickup_expired(_handle: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;handle&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 pickup ran out of lifetime and vanished untaken.&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;server.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. &amp;lt;code&amp;gt;entity&amp;lt;/code&amp;gt; is its entity id (see &amp;lt;code&amp;gt;api.bosses&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; the health it lost, and &amp;lt;code&amp;gt;attacker&amp;lt;/code&amp;gt; the player who dealt it, or -1 for nobody. &amp;lt;code&amp;gt;api.entity_health&amp;lt;/code&amp;gt; already 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;server.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. &amp;lt;code&amp;gt;killer&amp;lt;/code&amp;gt; is the player who landed the last blow, or -1 for nobody. It sinks into its pool and stays dead; what that means for the match, killing the enemy&amp;amp;#39;s boss wins, say, is the mode&amp;amp;#39;s to decide.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _door_changed ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_door_changed&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_door_changed(_door: StringName, _state: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;door&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;state&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 door moved to a new state: &amp;lt;code&amp;gt;api.DOOR_OPENING&amp;lt;/code&amp;gt; when it starts to open, &amp;lt;code&amp;gt;api.DOOR_OPEN&amp;lt;/code&amp;gt; once it is open, &amp;lt;code&amp;gt;api.DOOR_CLOSING&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;api.DOOR_CLOSED&amp;lt;/code&amp;gt; the same way back. Whoever moved it, a player walking up, its own wait running out, or this script, the hook is the same.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _logic_event ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_logic_event&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_logic_event(_entity: StringName, _event: StringName, _activator: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;server.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;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;event&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;activator&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 logic entity the map places (a relay, timer, counter or button, by its name in the level editor) raised &amp;lt;code&amp;gt;event&amp;lt;/code&amp;gt;: &amp;quot;OnTrigger&amp;quot;, &amp;quot;OnTimer&amp;quot;, &amp;quot;OutValue&amp;quot;, &amp;quot;OnHitMin&amp;quot;, &amp;quot;OnHitMax&amp;quot;, &amp;quot;OnPressed&amp;quot; or &amp;quot;OnUseLocked&amp;quot;. &amp;lt;code&amp;gt;activator&amp;lt;/code&amp;gt; is the player who set it off, 0 for nobody. Its outputs fire whatever this does; this is where a mode reacts to a button press or a counter filling up.&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;server.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 zone and pickup hooks. &amp;lt;code&amp;gt;delta&amp;lt;/code&amp;gt; is the seconds since the last tick. Timers and win checks go here. Stops once a winner is declared.&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>