Lua creating spawns

Hey, I need to create spawns via Lua to override the spawns on a map. Is this possible?

All help is appreciated!

Spawn entities or spawn locations?

Spawn Locations

Set player’s position in PlayerSpawn.
[lua]local spawns = {
Vector(0, 0, 0),
Vector(0, 0, 128)
};

hook.Add(“PlayerSpawn”, “Some unique name for the hook”, function(ply)
ply:SetPos(table.Random(spawns));
end);[/lua]

Just asking but why are there two vectors?

It chooses a random vector out of a list of vectors.

Okay that’s what i was thinking it does but wasn’t really sure, thanks