How to reserve a server for one person and only let his friends join it

I want to make a party system where one player creates a party and teleport to another place but I want this place to be private. so I create an UI on the first place where they can see the friend online on the other server (note: I know how to make this ui and setup for seeing friends online and stuff) but how should I work witht he private server. I was thinking of doing it to teleporttoprivateserver but How do I get the acces code then for the other friends to join that place?

this is the script that I have for making a private server for one person

for the local player:

script.Parent.MouseButton1Click:Connect(function()
	
	game.ReplicatedStorage.ReserveServer:FireServer()
	
end)

for the server

local tps = game:GetService("TeleportService")

game.ReplicatedStorage.ReserveServer.OnServerEvent:Connect(function(player)
	local plrs = {player}
	
	local code = tps:ReserveServer(3934008719)
	tps:TeleportToPrivateServer(4315535044, player, plrs)
	
end)

Don’t need a script for this, make a vip server.

1 Like

Why do you have a mouse click function? Lol do u have a gui somewhere?

1 Like

But the teleport is not to a different game, to a different place into my game

Ok, then you don’t want a server.

I’m not really that knowledge able on teleport service and all that fun stuff but couldn’t you use the DataModel | Documentation - Roblox Creator Hub as the ID of the server to teleport the friend to.

yes I need a different place but with private servers

Reserve a server and teleport all the players into it?

Make it so only those players could join

not exact what I needed, I know how to do that but I have a place where there is only max 1 player in it and via this place I want to teleport to another place where there can be 4 players in it but this must be in a private server

but how to I get the code from the privateserver then

OHHHHH, create a new game and teleport all the players there…

You can use this DataModel | Documentation - Roblox Creator Hub to get the ID of the private server from there you can find a way to tell their friends about the code and teleport them using that code. How you do that is up to you.

I will try to use it and let you know

I tried it and it’s not the right way, I guess I have to solve it via another way, thanks for the responds

You’re welcome, sorry if your problem was not solved.

1 Like