local replicatedstorage = game:GetService("ReplicatedStorage") local status = replicatedstorage:WaitForChild("StatusValue") while true do -- Intermission for i = 30, 0, -1 do status.Value = "Intermission: " .. i wait(1) end local map = game.ServerStorage.GlassMap map:Clone().Parent = workspace wait(15) map:Destroy() status.Value = "Game End" end --// For future reference, your code has to go in between two sets of tildes(~). You had an extra one messing it up.
I want it to teleport them to the map when the map loads and when the map destroys i want it to teleport them back to the lobby is that possible to fix?
players = game:GetService("Players") -- loop to get every player in the game for _, player in pairs(players) do local character = player.Character --check if the player is not dead if character then character:SetPrimaryPartCFrame(spawn_part.CFrame) --you must create a variable for the spawn part end end
So it would look like this:
local replicatedstorage = game:GetService("ReplicatedStorage") local status = replicatedstorage:WaitForChild("StatusValue") players = game:GetService("Players") lobby_spawn = game.Workspace.Spawn --change this to the lobby spawn/part while true do -- Intermission for i = 30, 0, -1 do status.Value = "Intermission: " .. i wait(1) end local map = game.ServerStorage.GlassMap map:Clone().Parent = workspace spawn_part = map.Spawn --insert a spawn/part named "Spawn" in the map model for _, player in pairs(players) do local character = player.Character if character then character:SetPrimaryPartCFrame(spawn_part.CFrame) end end wait(15) for _, player in pairs(players) do local character = player.Character if character then character:SetPrimaryPartCFrame(lobby_spawn.CFrame) end end map:Destroy() status.Value = "Game End" end
this will teleport them to the map and then you just have to repeat the loop but using the lobby's spawn. Hope I helped!