Issues with SpawnLocation

I’m having issues with the spawn locations. It seems that the engine is ignoring the enabled bit and is spawning players at spawn points where enabled is false. It also seems to be ignoring Players:RespawnLocation even though it’s been set correctly.

local rand = Random.new(os.clock())
local spawnFolder = game.Workspace.SpawnPlane.Spawn


local spawns = spawnFolder:GetChildren()
local sploc = spawns[rand:NextInteger(1, #spawns)]
print(sploc)
player.RespawnLocation = sploc

The print statement does print “InitalSpawn” so I know that Player:RespawnLocation is being set with valid data. At this point, I’m not sure what to do.

The code you provided looks like it should function, can we see more of it

I just discovered that something else is going on. I added a remove spawn function to remove the spawns on the map and the players are still spawning on the map. I verified on the server instance in Explorer that the spawn have, in fact, been removed. So I’m going to have to step through the code to find out what is going on. It’s almost like the player is getting teleported from the spawn plane to the map.