Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you create a object that makes a group of players go into a reserved server?

Like in Camping (created by SamsonXVI).

Players go into a server, but players outside of that server cannot join.

Thanks.

Edit: As in I need a script to help me. Thanks

1 comment

0

The script I posted did help. It is a reserved server.

2 answers

✓ Accepted answer

Simple. In the TeleportService There is a function named TeleportToPrivateServer Which people has also used to make free VIP servers in game with commands as well as minigames as like the story games.

If its one player being teleported with a localscript

local Teleportservice = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
local ID = "Remove the quotation marks and put a game ID here"

Teleportservice:TeleportToPrivateServer(player, ID)

If its one player being teleported with a serverscript

local Teleportservice = game:GetService("TeleportService")
local playername = "HeyItzscoop"
local ID = "Remove the quotation marks and put a game ID here"

for i,v in pairs (game.Players:GetChildren()) do
if v.Name == player then
	Teleportservice:TeleportToPrivateServer(v, ID)
end
end

If its a whole party of people with a serverscript

local Teleportservice = game:GetService("TeleportService")
local players = {}
local ID = "Remove the quotation marks and put a game ID here"

for i,v in pairs(players) do
	for i,player in pairs(game.Players:GetChildren()) do
		if player.UserId == v then
			Teleportservice:TeleportToPrivateServer(player, ID)
		end
	end
end

-- Use above for teleporting the party. Use below for adding people to the party in a serverscript (User must use /join to join queue)

game.Players.PlayerAdded:connect(function(Player)
	Player.Chatted:connect(function(message)
		if message == "/join" then
			table.insert(players, Player.UserId)
		end
	end)
end)

3 comments

0

great answer, but consider using Players:GetPlayers(), also use, TeleportService:TeleportPartyAsync() when teleporting a group as it's a lot reliable than using a loop.. but great answer

0

its not a great answer cuz the Question was a Request

0

its not a great answer cuz the Question was a Request

get players in a certain area and teleport them or you can just make list of players waiting (table) and teleport them

This discussion is preserved as it was. New answers, comments, and votes are closed.