Level Editor/Scripting/Reference/GamemodeClientScript

From TeamSpec Wiki
Revision as of 03:48, 20 October 2026 by TeamSpecBot (talk | contribs) (Scripting reference: GamemodeClientScript)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The base class of client.gd: the script starts with extends GamemodeClientScript.

The base class of a map's client.gd: what its gamemode shows.

This script runs on every player'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 api.

It declares nothing: the server's counters and teams arrive by themselves.

See Level Editor/Scripting/Reference for every class, and Level Editor/Scripting/Reference/Sandbox for the rest of GDScript a script may use.

Properties

api

api: GamemodeClientApi
Property · Available to client.gd

Everything this script can do goes through api. See GamemodeClientApi.

Everything this script can do, as a GamemodeClientApi.

Hooks

_start

_start() -> void
Hook · Available to client.gd

The server's counters and teams have arrived and can be read. Put your HUD widgets on screen here.

Returns: void

_counter_changed

_counter_changed(_scope: int, _key: int, _name: StringName, _value: int) -> void
Hook · Available to client.gd

A counter changed. scope is api.SCOPE_PLAYER, api.SCOPE_TEAM or api.SCOPE_GLOBAL; key is the player'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.

Parameters
  • scope: int
  • key: int
  • name: StringName
  • value: int
    Returns: void

_match_ended

_match_ended(_team: int) -> void
Hook · Available to client.gd

The round is decided. team is the winner, or 0 for a draw.

Parameters
  • team: int
    Returns: void
TeamSpec Level Editor
Basics Getting started · Interface · Viewport and camera · Selecting and hiding · Keyboard shortcuts · Settings · Map Config · Troubleshooting
Menus File · Edit · View · Tools · Functional
Panels Scene tree · Inspector · Materials · Props · Snapping · UV editor · Displacement · Terrain
Tools Move, Rotate and Scale · Box · Sphere · Cylinder · Prism · Stairs · Spiral Stairs · Spiral Tower · Arch · Path Brush · Plane · Terrain · Clip · Duplicate · Ruler and Cordon · Edit Vertex and Edge · Edit Face · Loop Cut · Material Brush · Vertex Color Brush · Displacement · Prop Path
Entities Brush · Zone · Group · Mirror Node · Prop · Spawn Point · Supply Pickup · World Boundary · Lights · Water · Sounds · Anchor Platform · Payload Track · Boss Spawn · Map Marker · World Text · Decal · Door · Button · Logic entities · 3D Skybox · Nav Region
Workflows Your first map · Brushes and CSG · Materials and UVs · Lighting and lightmaps · Bots and navigation · Mirrored maps · Outputs and logic · Custom assets · Playtesting · Exporting and publishing · Importing Source maps
Scripting Overview · Server rules · Client HUD · Bots · Teams and spawning · Zones · Pickups · Payload tracks · Map entities · Sandbox limits · Testing · King of the Hill · Team Deathmatch · API reference · What a script may use