I want to Teleport a Group of Players to a Certain Server in another Game i already know how to teleport but its ot guarenteed that they will all end up in the same one.
i know how to teleport already but it sends them to the wrong place.
function onTouched(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(0000000,player) end end script.Parent.Touched:connect(onTouched)
I know i put 000000 there it does work
You can use TeleportService:ReserveServer()
What this does, is it creates a sort of private server. Only people with the code can enter it. This code is created when you reserve a server.
Here's a basic script:
local TeleportService = game:GetService("TeleportService") local function onHit(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then local code = TeleportService:ReserveServer(game.PlaceId) -- Requires game to be published TeleportService:TeleportToPrivateServer(game.PlaceId, code, player) end end)
I can understand if you do not want to teleport the players to a private server, however this is all the knowledge I could help you with.
For more information related to TeleportService visit this link: https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportToPrivateServer