G’Day
I’m trying to utilize TeleportToPrivateServer so that any new players cant join any existing players.
I thought it was working properly but it seems it isn’t now, not sure if it has anything to do with how I’ve used the que function or if I’ve made a mistake with the Teleport function.
Any help is greatly appreciated.
Below is a corresponding section of my code which is in a normal script and is located in server script service
local code = TS:ReserveServer(7204521869)
local Queue = {}
local alreadyExists = false
AddToQueue.OnServerEvent:Connect(function(plr)
for i=1,#Queue do
if Queue[i] == plr.Name then
alreadyExists = true
end
end
if alreadyExists == false then
if #Queue < 6 then
table.insert(Queue, plr)
for index, player in pairs(Queue) do
wait(1)
StartTimer:FireAllClients(30)
TeleportNow.OnServerEvent:Connect(function()
TS:TeleportToPrivateServer(7204521869, code, Queue)
Queue[index] = nil
end)
end
end
end
end)