GetRandomSpawnPoint
One spawn point of a tag, at random.
Syntax
Section titled “Syntax”GetRandomSpawnPoint([tag])| Parameter | Type | |
|---|---|---|
tag |
string | the list ("" without) (optional) |
Returns
Section titled “Returns”number, number, number, number - a point as x, y, z, yaw; nil when the list is empty
Example
Section titled “Example”function OnPlayerRequestSpawn(pid) local x, y, z, yaw = GetRandomSpawnPoint(GetPlayerData(pid, "team") or "red") if x then SetSpawnInfo(pid, x, y, z, yaw) end return trueendSee also
Section titled “See also”AddSpawnPoint · SetSpawnInfo · the Players group of the index
