Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

0
The script I posted did help. It is a reserved server. Lakodex 711 — 4y

2 answers

Log in to vote
1
Answered by
Lakodex 711 Moderation Voter
4 years ago
Edited 4 years ago

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)
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 User#23252 26 — 4y
0
its not a great answer cuz the Question was a Request Luka_Gaming07 534 — 4y
0
its not a great answer cuz the Question was a Request Luka_Gaming07 534 — 4y
Ad
Log in to vote
0
Answered by
KoruZX 35
4 years ago

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

Answer this question