You can write your topic however you want, but you need to answer these questions:
I want to be able to teleport to a private server again.
What is the issue? Include screenshots / videos if possible!
I keep getting this error. Everything worked and I know my code isn’t wrong because it worked but now suddenly I keep getting this weird error on the client side.
local TeleportTable = {}
for i,v in pairs(PlayersInRoomTable) do
table.insert(TeleportTable,Players:GetPlayerByUserId(v))
end
local ReserveCode = TeleportService:ReserveServer(10589338090)
TeleportService:TeleportToPrivateServer(10589338090, ReserveCode, TeleportTable)`
Im pretty new to lua so my code may be a little messy. But this is pretty much all of the important code.
`if EnoughPlayers.Value == true or EnoughVotes.Value == true then
RoomStatus.Value = "Game starting in 1!"
wait(1)
if EnoughPlayers.Value == true or EnoughVotes.Value == true then
RoomStatus.Value = "Teleporting players..."
local TeleportTable = {}
for i,v in pairs(PlayersInRoomTable) do
table.insert(TeleportTable,Players:GetPlayerByUserId(v))
end
local ReserveCode = TeleportService:ReserveServer(10589338090)
TeleportService:TeleportToPrivateServer(10589338090, ReserveCode, TeleportTable)
for i, v in pairs(PlayersInRoomTable) do
local PlayerGui = Players:GetPlayerByUserId(v):FindFirstChild("PlayerGui")
local TeleportScreenGui = ReplicatedStorage.TeleportScreenGui
local NewTeleportScreenGui = TeleportScreenGui:Clone()
NewTeleportScreenGui.Parent = PlayerGui
local BlackFrame = NewTeleportScreenGui.BlackFrame
BlackFrame.Visible = true
PlayersInRoom.Value = PlayersInRoom.Value - 1
for index, PlayersThatVote in pairs(PlayersWhoVotedTable) do
if v == PlayersThatVote then
PlayersWhoVoted.Value = PlayersWhoVoted.Value - 1
table.remove(PlayersWhoVotedTable, PlayersThatVote)
table.remove(PlayersWhoVotedTable, index)
VoteStatus.Value = PlayersWhoVoted.Value.."/"..PlayersInRoom.Value
end
end
table.remove(PlayersInRoomTable, v)
table.remove(PlayersInRoomTable, i)
PlayerLeftRoom:FireAllClients(Players:GetPlayerByUserId(v), PlayersInRoom.Value)
end
end`