<?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%2FGamemodeClientScript</id>
	<title>Level Editor/Scripting/Reference/GamemodeClientScript - 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%2FGamemodeClientScript"/>
	<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeClientScript&amp;action=history"/>
	<updated>2026-10-28T07:03:52Z</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/GamemodeClientScript&amp;diff=117&amp;oldid=prev</id>
		<title>TeamSpecBot: Scripting reference: GamemodeClientScript</title>
		<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Reference/GamemodeClientScript&amp;diff=117&amp;oldid=prev"/>
		<updated>2026-10-20T03:48:30Z</updated>

		<summary type="html">&lt;p&gt;Scripting reference: GamemodeClientScript&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;client.gd&amp;lt;/code&amp;gt;: the script starts with &amp;lt;code&amp;gt;extends GamemodeClientScript&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;client.gd&amp;lt;/code&amp;gt;: what its gamemode shows.&lt;br /&gt;
&lt;br /&gt;
This script runs on every player&amp;amp;#39;s machine. It can read the counters the server keeps and put HUD widgets on screen, and it cannot change anything about the match. Everything it can do goes through &amp;lt;code&amp;gt;api&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It declares nothing: the server&amp;amp;#39;s counters and teams arrive by themselves.&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: GamemodeClientApi&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;client.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/GamemodeClientApi|GamemodeClientApi]].&lt;br /&gt;
&lt;br /&gt;
Everything this script can do, as a &amp;lt;code&amp;gt;GamemodeClientApi&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;client.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 server&amp;amp;#39;s counters and teams have arrived and can be read. Put your HUD widgets on screen here.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _counter_changed ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_counter_changed&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_counter_changed(_scope: int, _key: int, _name: StringName, _value: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;client.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &amp;lt;code&amp;gt;scope&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;StringName&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;value&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 counter changed. &amp;lt;code&amp;gt;scope&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;api.SCOPE_PLAYER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;api.SCOPE_TEAM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;api.SCOPE_GLOBAL&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; is the player&amp;amp;#39;s entity id, the team, or 0 for a global counter. Widgets update by themselves, so this is only needed for something of your own.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== _match_ended ===&lt;br /&gt;
{{API member&lt;br /&gt;
|name=_match_ended&lt;br /&gt;
|kind=Hook&lt;br /&gt;
|signature=_match_ended(_team: int) -&amp;amp;gt; void&lt;br /&gt;
|scripts=&amp;lt;code&amp;gt;client.gd&amp;lt;/code&amp;gt;&lt;br /&gt;
|params=* &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;void&amp;lt;/code&amp;gt;&lt;br /&gt;
|description=The round is decided. &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt; is the winner, or 0 for a draw.&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>