TeleportToPrivateServer

I want to send information with the players that I transfer so that I specify a specific player and give him a value for a case like strange value

use

TeleportToPrivateServer

There is a parameter for TeleportToPrivateServer for teleportData

Create a ReservedServer and a ReservedServerId you can generate one or get one from roblox ingame by printing it

Create a ReservedServer and a ReservedServerId you can generate one or get one from roblox ingame by printing it

	--> TeleportService
	local TeleportService = game:GetService("TeleportService")
					
	--> Teleport Resources
	local ReserveServer = TeleportService:ReserveServer(placeId)
	local TeleportOptions = Instance.new("TeleportOptions")
					
	--> Teleport Properties , Functions
       TeleportOptions.ReservedServerAccessCode = ReserveServer:split(" ")[1] --> Reserve Server have two values we need only the first so we split it to spaces and get the first
					
      TeleportService:TeleportAsync(placeId, {aPlayerObjectExample}, TeleportOptions)

You can bind it to a playeradded event like:

game.Players.PlayerAdded:Connect(function(player)
	--> TeleportService
	local TeleportService = game:GetService("TeleportService")
					
	--> Teleport Resources
	local ReserveServer = TeleportService:ReserveServer(placeId)
	local TeleportOptions = Instance.new("TeleportOptions")
					
	-> Teleport Properties , Functions
	TeleportOptions.ReservedServerAccessCode = ReserveServer:split(" ")[1] --> Reserve Server have two values we need only the first so we split it to spaces and get the first
					
	TeleportService:TeleportAsync(placeId, {player}, TeleportOptions)
end)

or teleport all with for loop command:

for _, player in game.Players:GetPlayers() do
	--> TeleportService
	local TeleportService = game:GetService("TeleportService")
					
	--> Teleport Resources
	local ReserveServer = TeleportService:ReserveServer(placeId)
	local TeleportOptions = Instance.new("TeleportOptions")
					
	-> Teleport Properties , Functions
	TeleportOptions.ReservedServerAccessCode = ReserveServer:split(" ")[1] --> Reserve Server have two values we need only the first so we split it to spaces and get the first
					
	TeleportService:TeleportAsync(placeId, {player}, TeleportOptions)
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.