Codectionary / Developer documentation / Luau

SpawnLocation

Choose where characters can spawn in a place.

Why use SpawnLocation?

SpawnLocation is a special BasePart used by Roblox character spawning. Its Neutral and TeamColor settings help determine eligible players; layout and obstruction still matter.

Try it in Roblox Studio

Put this Script in ServerScriptService and test player respawns in Studio. Position the spawn in a safe open area.

Syntax

spawn.Neutral = true

Examples

SpawnLocation

Create a neutral spawn pad.

local spawn = Instance.new("SpawnLocation")
spawn.Name = "PracticeSpawn"
spawn.Size = Vector3.new(8, 1, 8)
spawn.Position = Vector3.new(0, 2, 0)
spawn.Anchored = true
spawn.Neutral = true
spawn.Parent = workspace
  1. The SpawnLocation is placed in Workspace like a physical part.
  2. Neutral = true makes it eligible regardless of a player’s team.
  3. If several eligible spawn pads exist, this example does not guarantee the next spawn uses this exact pad.

Best practices

  • Leave clear space above a spawn pad.
  • Test team and neutral spawn rules with multiple players.

Runtime & versions

Luau host; Roblox engine examples require Roblox Studio. Feature availability depends on the language and runtime version used by your project; consult the official reference below.

Luau documentation

Specifications & further reading