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

How to keep a group of players together when traveling between places? (Answered)

Asked by
sssynk 58
4 years ago
Edited 4 years ago

Hello all, I have been working on a story game, similar to the game "Camping" if any of you have ever played that. I am trying to keep a group of players together as I have multiple places to travel between which all include a different part of the story. I want to create a new server for each group, and not let anyone from another group join a different group on a server that has already started the story. So essentially, I want to create a new server on each place that the group travels to, and not let any other group (or player) join a server that has already started the game. Thanks!

-- ItzHiimnew

0
TeleportService has the ability to teleport multiple players to a game, or are you doing this in one game? DeceptiveCaster 3761 — 4y
0
It is in multiple games, and I am using TeleportService, but I need to keep those players in the same group without joining another group. sssynk 58 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

This is actually pretty simple and uses TeleportService. I have the same system in my game and it works perfectly. I'll just write you a function that will teleport every player in a table to a certain place, and no one else will be in or be able to join that server except the players in the group

Then you will be able to read on how it works Function:

function TeleportGroup(placeId,group)
       local TS = game:GetService("TeleportService")
       local key = TS: ReserveServer(placeId)
       TS:TeleportToPrivateServer(placeId,key,group)
end
-- Example:
TeleportGroup(1234,{game.Players.Bob,game.Players.Shedletsky)
0
Maybe ItzHiimnew's awenser will be better, i posted this awenser before reading his/her's one. spicychilly2 145 — 4y
0
Crap I forgot to close the table on column 20, but you can figure it out. spicychilly2 145 — 4y
Ad
Log in to vote
0
Answered by
sssynk 58
4 years ago

I believe I found an answer, I am going to test it out: https://devforum.roblox.com/t/party-teleports-are-live-for-all-users/128577

Answer this question