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

Reserve server players ending up in the same server?

So I am trying to make a lobby which teleports the players who are in a tube into the same server using reserve server. The way I'm trying to do it, and correct me if this is horrid, but I have a remotevent which fires to the client, back to the server, creates a table of all the players and teleports them. This does work but then a new player teleports, he gets put in the same game as the previous players. I do not receive error codes, or any sort of warning.

This is the teleporting script:

local teleportService = game:GetService("TeleportService")
local code = teleportService:ReserveServer(6879552528)
local teleportPlace = 6879552528


script.Parent.TeleportingEvent.OnServerEvent:Connect(function(player)
	local Playerr = {}
	table.insert(Playerr, player)
	teleportService:TeleportToPrivateServer(teleportPlace,code,Playerr)
end)

2 comments

0

Also when I print the number of players in that table, only 1 shows.

0

you mentioned that you " have a remotevent which fires to the client, back to the server " , shouldn't you use a RemoteFunction instead?

1 answer

You said only one player is printed in the print table, I think you should use an in pairs() loop to gather all the players and in each in pairs loop fire the RemoteEvent or RemoteFunction

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