Hey, I’m trying to teleport all players into a map that’s randomly chosen from Replicated Storage. However, I am getting an error which reads:
"Unable to assign property CFrame. CoordinateFrame expected, got nil"
This is the script I have wrote for the Teleport Section of it:
--// Intermission
for i = 20, 0, -1 do --// 20 = Intermission Length
Status.Value = "Intermission in: "..i
task.wait(1)
end
local ChosenMap = Maps[math.random(1, #Maps)]:Clone()
local SpawnLocations = ChosenMap:FindFirstChild("TeleportPoint"):GetChildren()
ChosenMap.Parent = game.Workspace
Status.Value = "Map Chosen: "..ChosenMap.Name
task.wait(5)
print("Teleporting to Map")
--// Telporting
for i, Player in pairs(game.Players:GetPlayers()) do
local character = Player.Character
if character then
local HRP = character.HumanoidRootPart
HRP.CFrame = SpawnLocations.CFrame
end
end