How do I make it so that it creates a new server?

Good evening Roblox developer forum. I’m new to teleportation service and I think I’m getting the hang of it, but this stumped me because I don’t really know how to fix it.

local TeleportService = game:GetService("TeleportService")

local Paren = script.Parent
local placeId = 127208276999070 

local B = Instance.new("TeleportOptions")
B.ShouldReserveServer = true 

local function Tele(Person)

	TeleportService:TeleportAsync(placeId,{Person},B)
end

Paren.Triggered:Connect(Tele)

I genuinely am very stumped, if someone can help me with this and provide a source for learning more about this (outside of the documentation that would be nice :]

3 Likes

You would need to use ReserveServer and then teleport the server to the private server.

For example:

local TeleportService = game:GetService("TeleportService")

local PLACE_ID = 123456789
local privateServerCode = TeleportService:ReserveServer(PLACE_ID)
TeleportService:TeleportToPrivateServer(PLACE_ID, privateServerCode, {player})

(I know it’s in documentation, sorry, but it’s very helpful and theres lots of code examples :slight_smile: )

2 Likes

So what the code is basically doing, is Reserving a server, and that server is being used as the private server code for the player, if you’re correct, it creates a new server for the player right?


Now how do I

Correct, it reserves a new server and teleports them to it.

Honestly unsure why you’re seeing this error. :thinking:

well it’s not really an “error” but it’s a thing that happens when the server gets filled, I want it to create a new server but it just ends up going to the same server


local Paren = script.Parent
local placeId = 127208276999070 

local B = TeleportService:ReserveServer(placeId)

local function Tele(Person)

	TeleportService:TeleportToPrivateServer(placeId,B,{Person})
end

Paren.Triggered:Connect(Tele)

Here’s the updated code btw

Are you trying to use the teleport inside of studio or on the actual player?

the actual player, (keystroke filler yayayaya)

That’s because you’re reserving the server code once when the script runs initially. Now if I understand correctly, you want to make it reserve for each person. So reserve the server code for each person inside the Tele function

3 Likes

Ohh I see, so put the variable “B” in the new code inside of the function?

1 Like

Exactly like that, yes
///////////////

2 Likes

alrighty, imma try this out :innocent: :innocent: :innocent:

1 Like

Thank you my glorius blud boy!! MAY GOD BLESS YOU THIS YEAR!!!

2 Likes

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