I am trying to make a game where you can join a group and when the group leader click a ui everyone in the group teleports to the same server. Kind of like Entry Point and Notoriety. I am not that good at scripting so I don’t understand much about Teleport scripts and I don’t have robux to hire people.
I have tried to make those scripts myself by learning from tutorials and reading other post but I still don’t understand (unless I just couldn’t find the right one).
This is my second post and I am quite new to the forum if I did any mistakes in my post please tell me.
You can use RemoteEvents to have the client tell the server teleport all the players.
Server
local placeId = 123
local leaderUserId = 1
local partyPlayersList = {
game:GetService('Players').Player1,
game:GetService('Players').Player2
}
game:GetService('ReplicatedStorage').TeleportSquad.OnServerEvent:Connect(function(player) -- Connects a function to execute when the "TeleportSquad" event is fired
if player.UserId == leaderUserId then -- Checks if the player who clicked the start button is equal to the party leader
game:GetService('TeleportService'):TeleportPartyAsync(placeId, partyPlayersList) -- Teleports all players in "partyPlayersList"
end
end)
Client
StartButton.MouseButton1Click:Connect(function() -- Connects a function to execute when the client clicks the button
game:GetService('ReplicatedStorage').TeleportSquad:FireServer() -- Fires the remote event
end)
This is just an example, but I would have a dictionary of parties containing data such as the leader and squad players.
Server
local Parties = {}
game:GetService('ReplicatedStorage').CreateSquad.OnServerEvent:Connect(function(player)
if not Parties[player.UserId] then -- Check if the player has already created a party by attempting to index it in the "Parties" table
Parties[player.UserId] = { -- Create the party data
Players = {}
}
end
end)
Yes, but that is something you will need to do. The code above is just examples and will need some changes and more work such as joining parties to work on production.
Teleporting a group of players can be done with TeleportPartyAsync, but that’s not what either Entry Point or Notoriety use. TeleportPartyAsync won’t achieve your specific use case properly, it is merely a grouped version of the default teleport function.
For Entry Point and Notoriety’s specific kind of party teleporting, they make use of reserved servers and TeleportToPrivateServer. A server is created under a specific place for members of a party and each are teleported to that server.
All other learning curves come from researching the needs of your systems and experimentation. I’d like to explain to you, but that’s not quite the point of this thread. If you have any other detailed questions, you’re welcome to open a new thread specific to that situation.
Make sure to do a bit of research first and ask about things you’re uncertain of.
I meant that in a fairly literal sense. The base teleport function is Teleport, which only allows you to teleport a single player to a specific place. On the other hand, TeleportPartyAsync allows you to teleport multiple players to a specific place.
This is good if you don’t mind public servers, but for matchmaking this won’t work. Your use case also explained that you were looking for private matches like Entry Point and Notoriety; the above functions I mentioned will accomplish that for you. You can send a group of players to a specific place and a specific server reserved for the members of a party.
No, these things don’t typically come with explicit tutorials since they’re very specific use cases. You can try searching up tutorials or experimenting around with these functions on your own time, if there are any available. There may even be an open source example regarding the application of them.