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

How do we teleport a group of players in a SAME server in a place?

Asked by 4 years ago
Edited 4 years ago

So I have tried with the "reserveServer" function, but it just pops out in the output "HTTP403 "ReserveServer()" Forbidden" or something like that. I've also tried with TeleportPartyAsync() but it doesn't work either. First I thought it could just work in the public game, and not in the studio. I published and tested it on a public server, but it didn't work too. Can you help me, please? Or is there another way to do this? Also, it will be likely to use reserve server, because after teleporting them, nobody else can join them and that's what I want to do.

0
Literally i asked the same question. :/ Alibolly 10 — 4y
0
nope, you said the ENTIRE server and mine is just a group of player, that teleports into a PLACE, in the SAME server TheRealPotatoChips 793 — 4y
0
also, this is for a camping game, so I want them to tp in the same PLACE server TheRealPotatoChips 793 — 4y
0
okay nice did not see group. Alibolly 10 — 4y
View all comments (3 more)
0
I added a script excerpt AltNature 169 — 4y
0
I added a script excerpt AltNature 169 — 4y

4 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Make sure the PLACE you are going to teleport into is in the same GAME

If you don't know what that mean A GAME can have multiple PLACES, a starter place where the players spawn and branch places where they can teleport to

if you want to teleport from a GAME to a different GAME, then you need to put id of the STARTER PLACE from the GAME you wan't to teleport to

0
Dude that doesn't answer my question, did you read it? TheRealPotatoChips 793 — 4y
0
Yes i did... Azure_Kite 885 — 4y
0
My question is how do we let that group of players join the same place (that place is in the game), in t TheRealPotatoChips 793 — 4y
0
In the same server of the place* TheRealPotatoChips 793 — 4y
View all comments (3 more)
0
Post the script you used Azure_Kite 885 — 4y
0
K so that place has servers too. But when you simply teleport players there, the program randomizes the servers in that place that they join. So how do we let a group of players join in the same place's server TheRealPotatoChips 793 — 4y
0
Wait I cannot post the script I'm not at home, just on my phone. I will tomorrow. TheRealPotatoChips 793 — 4y
Ad
Log in to vote
0
Answered by
AltNature 169
4 years ago
Edited 4 years ago

In order to let a group of players to go to the same place, get the children of Players - GetChildren() or you could make a table with their User ID's , then you can simultaneously teleport them all to the same place in the same game.

function teleport()
 -- teleport players
end

local players = {} -- have their ID's

for i, v in pairs[players] do
       teleport()
wait(1) -- teleport them with 1 second intervals
end

Hope it helps!

AltNature [Lua / Blenderer]#2828

0
Can you post a code sample? It will be very helpful! TheRealPotatoChips 793 — 4y
0
Scrolldown for script sample Azure_Kite 885 — 4y
0
Wait but does it teleport them in the same server? TheRealPotatoChips 793 — 4y
View all comments (2 more)
0
yes you are the one that decides where they go AltNature 169 — 4y
0
I have a feeling you want me to make you your script, which is not what I want to do. Sorry! AltNature 169 — 4y
Log in to vote
0
Answered by 4 years ago

OR this might work too!

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)
Log in to vote
0
Answered by 4 years ago
    for i,v in pairs(game.Players:GetPlayers()) do -- gets every player in the server
    game:GetService("TeleportService"):Teleport(game.PlaceId, player) -- teleports them to the same game
    if player.Character ~= nil then
        player.Character:remove()
    end
end

Answer this question