Issues with teleporting players to spawn points of a random map?
I've made a game loop for my game.
Before the game starts, the script selects a random map out of a certain folder and teleports all players in the game to it.
Here's the script, let me know if anything seems off. (It's in a Server Script in ServerScriptService if that helps)
01 | local maps = game.Lighting.Maps:GetChildren() |
03 | chosenMap = maps [ math.random( 1 ,#maps) ] |
04 | chosenMap:Clone().Parent = workspace |
06 | for i,v in pairs (game.Players:GetChildren()) do |
08 | v.Character.Torso.CFrame = workspace:FindFirstChild(chosenMap.Name).Spawns.CFrame |
What's happening is that it keeps the player inside the designated intermission location (a building I created) and the script doesn't allow any of the players to be teleported.
What's weird is that the script was working just fine earlier, I don't think I made any changes that should affect the teleportation.
My output states that "CFrame is not a valid member of Folder"