Does anyone know how to make a teleporter that teleports every body in the whole game when u touch it

I need a teleporter that teleports every body in the whole intire game

Is this what you’re looking for?

function TeleportAllPlayers() -- Creates a function
	for i, plr in pairs(game.Players:GetPlayers()) do -- loops through all the players
		plr.Character.HumanoidRootPart.CFrame = game.Workspace.TeleportPart.CFrame + Vector3.new(0,3,0) -- Teleports them to a part called "TeleportPart" in the workspace by moving there humanoid root part
	end
end

script.Parent.ClickDetector.MouseClick:Connect(function() -- This is what activates the teleport, change it to whatever event you want
	
	TeleportAllPlayers()
end)

Bro ima try u tried over 4 scripts people gave me and all failed ima try urs

wait its click dectcted? i want on touch

also i was talking about to another game is this to another area?

Oh wait sorry XD
Ima make it for you rq

1 Like

thank u i been trying this forever hopefully this works make sure its tocuhed pls

Alright, here you go! I tried to explain as much as possible

function TeleportAllPlayers() -- The teleport function
	local ServerID = nil -- Setting up the server ID
	local ServerToTeleportToOne = 6884731555 --PLACE ID HERE
	ServerID = ServerToTeleportToOne -- Sets the place id to the above variable


	local TeleportService = game:GetService("TeleportService") -- Gets teleport service

	local reserveserverCode = TeleportService:ReserveServer(ServerID) -- reserves a game server to be used

	TeleportService:TeleportToPrivateServer(ServerID,reserveserverCode,game.Players:GetPlayers()) -- teleports all the players
end

script.Parent.Touched:Connect(function(part) -- waits for the part to be touched, then fires
	local plr = game.Players:GetPlayerFromCharacter(part.Parent) -- checks if a player touched the part
	if plr then -- if it is a player, teleport everyone
		TeleportAllPlayers()
	end
end)
1 Like

thanks ima try rn and let u know if it works

alright, some things to note.
Once the players all join the server, new players won’t join a round that’s in progress.
The teleport only works outside of the studio in the real game
also, make sure your game setting is like this:


Settings are located here:

bro u did it thank u so much 3 other people gave me scripts and none worked thank you ima follow u

2 Likes

No problem :smiley:.
Hope your game goes well!

1 Like

thanks and thank u for helping me have a good day