How you teleport players to lobby from map?
for i,v in pairs(game.Players:getChildren()) do if v:findFirstChild("Character") then v.Character.Torso:MoveTo(0,0,0) -- change this to a position within the lobby end end
for _, v in pairs (game:GetService('Players'):GetPlayers()) do v.Character.Torso:MoveTo(POSITION) end
Well, you would have to make a boolean value to check if they are in the map.
--lets say the lobbys floor is named lobfloor-- inmap = false if inmap == true then for i,v in pairs(game.Players:GetPlayers()) do v.Character.Torso.CFrame = Workspace.lobfloor.CFrame * CFrame.new(math.random(10), 5, 0)) --math.random for not getting stuck-- end --lets say the maps floor is named base-- Workspace.base.Touched:connect(function(tuch) inmap = true end)
As you can see, we made a boolean value called inmap. If its false, it does nothing. If its true, it teleports all players to the lobby, hence when the maps floor is touched the boolean value is set to true, and instantly sends all of the players to the lobby.
You could use something physical like a 1 way tele or write in a script what the guy said above me