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

0

What's with the '--, Players) end' snippet?

0

That was code I took out. I forgot to delete it.

0

There, I took it out.

0

Do you have any idea why it does this though?

0

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.

0

I've published it many times.

0

Most of the code in your script proves unnecessary, all the way down to one line I believe, can you explain your code?

0

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?

0

you can use table.find() to know if a player is already in a table

0

The place is private

0

Do I have to make it public, for me to teleport to it?

0

Ok, they can tp to it now, but it only does the player that clicked the button?