Heres My Script
local status = game.ReplicatedStorage:WaitForChild("Status") local players = game.Players:GetChildren() local maps = game.Lighting.Maps:GetChildren() local currentmap = game.Workspace:WaitForChild("CurrentMap") local chosenmap = script:WaitForChild("ChosenMap") local spawner = game.Workspace:WaitForChild("Spawn") local choices = {} --Choose a random map function choosemap() for i = 1,#maps do if maps[i]:isA("Model")then table.insert(choices,maps[i]) end end local picked = math.random(1,#maps) chosenmap.Value = choices[picked].Name end --Load the map function loadMap() local map = game.Lighting.Maps:FindFirstChild(chosenmap.Value) map:Clone().Parent = currentmap end --Delete the map function deleteMap() for i,v in pairs(currentmap:GetChildren())do if v:isA("Model") then v:Destroy() end end end --Teleport all the players function teleportPlayers() for i,v in pairs(players)do v.Character.HumanoidRootPart.CFrame = currentmap:FindFirstChild(chosenmap.Value).Spawn.CFrame * CFrame.new(math.random(5,10),0,math.random(5,10)) end end --Teleport back the players function teleportBack() for i,v in pairs(players)do v.Character.HumanoidRootPart.CFrame = spawner.SpawnLocation.CFrame * CFrame.new(math.random(5,10),0,math.random(5,10)) end end --The whole cycle while true do status.Value = "Choosing Map..." wait(3) choosemap() status.Value = "Chosen Map: "..chosenmap.Value loadMap() wait(2) status.Value = "Teleporting Players.." wait(5) teleportPlayers() wait(60) deleteMap() teleportBack() end
This is not an error message, it is a warning. It is basically telling you that if the Spawn in the Workspace never loads then the script will wait for it forever. It is just a warning so you don't need to worry much but make sure at some point the spawn is created.
If you want to remove this warning you can put a time limit. That if the spawn doesn't loads in that much time the script will stop waiting for it. Here is the final script:
game.Workspace:WaitForChild("Spawn", 100)
The "100" means that the script will wait for it only 100 seconds if it is not loaded.
I hope this fixes your problem. If it does then don't forget to hit that "Accept Answer" button!