Back to TPG

TPG.Maps.GetSpawn

S🏷️ Maps

Part of TPG namespace

TPG.Maps.GetSpawn(teamId)
View on GitHub|gamemode/maps/_loader.lua:1076-1079
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

A team's spawn as written in the map config. This is the authored spawn, not the one in play: tpg.rounds.Setup swaps the two sides each round and publishes the result to TPG.State. To find out where a team actually spawns this round, use tpg.state.GetSpawn. Note the fallback is Vector(0, 0, 0), never nil, so a missing spawn reads as the map origin -- which is truthy, and on most maps is inside the world or under it. That is an out-of-world death god mode does not stop. tpg.state.GetSpawn exists to reject exactly this value; do not paper over a missing spawn by calling here instead.

Parameters

NameTypeDescription
teamIdnumberTEAM_GREEN or TEAM_RED.

Returns

TypeDescription
VectorThe authored spawn, or the map origin if there isn't one.

Examples

No examples available.

Used In

No usages found in the codebase.