Im taking out my code, used for my game. So, I have this script, that teleports players in the lobby. I finally finished it, and it worked, sort of. It teleported me to an empty baseplate... I made sure the right code was put in, and it is. I tried changing it to that place, with the lobbys and it teleported there. Im not sure if there's an issue with that place, or something's wrong with my script. I dont think so, because it teleported back to the lobby place, when I changed the numbers. Code:
local remote = game.ReplicatedStorage.StartEvent
remote.OnServerEvent:Connect(function(player)
for i, v in pairs(game.Players:GetPlayers()) do
local bool = v:FindFirstChildOfClass("BoolValue")
local frame = v.PlayerGui.ActiveLobbys.Frame.Frame.Frame
local player2 = frame.PlayerName.Text
local gameplaceid = 3313994275
local Player = player
local PlayersToTeleport = {}
local AlreadyInTable = false
for _,OtherPlayer in next,PlayersToTeleport do
if OtherPlayer == Player then
AlreadyInTable = true
end
end
if not AlreadyInTable then
table.insert(PlayersToTeleport,Player)
end
local TeleportService = game:GetService("TeleportService")
local Reserve = TeleportService:ReserveServer(gameplaceid)
TeleportService:TeleportToPrivateServer(gameplaceid, Reserve, PlayersToTeleport)
end
end
end)

12 comments
What's with the '--, Players) end' snippet?
That was code I took out. I forgot to delete it.
There, I took it out.
Do you have any idea why it does this though?
The issue could be that the place is not published: go to 'File' and click 'Publish To Roblox' in Studio with the loaded place you are transferring them too. Selecting this option will also update the place to it's latest version, which could also solve the problem.
I've published it many times.
Most of the code in your script proves unnecessary, all the way down to one line I believe, can you explain your code?
https://www.roblox.com/games/3313994275/Zombie-Survival-Server This game that you're trying to send them too, maybe it's todo with privacy settings?
you can use table.find() to know if a player is already in a table
The place is private
Do I have to make it public, for me to teleport to it?
Ok, they can tp to it now, but it only does the player that clicked the button?