Teleportin To Reserved Server not working

local function StartGame()
	
	print("function started")
	
	repeat wait()
		
		
	until PlayersInQueue >= 7
	print("ok")
	wait(10)
	
	
	if PlayersInQueue >= 7 then
		print("hello")
		for i,v in pairs(CurrentQueue) do
			print(v)
			local code = TS:ReserveServer(6794526866)
			TS:TeleportToPrivateServer(6794526866,code,v)
print("here")
		end
		
	end
	
	
	
	wait(10)
	
	
end

while wait() do
	--Pcall so that if it fails it will just restart
	local s,m = pcall(StartGame)
	--If s is false an error occured
	if not s then
		--Error Report
		if debugging then

		else
		end

	end
end

For some reason, It reaches the hello print, it prints the players name in v, then it doesn’t give me any errors, and it doesn’t rpint here it just restarts the function I have absolutely no idea why it’s not teleporting the player or giving me any teleport error if it’s printing their name

1 Like

I believe the 3rd parameter has to be an array of players so just put “v” in an array. Better yet, just remove the loop and pass “CurrentQueue” as the 3rd argument

2 Likes

I tried putting CurrentQueue as the arguement that doesn’t seem to be working either, {v} did work, but It sends us to seperate servers, how can I get all of us in the same one?

if PlayersInQueue >= 7 then
	local code = TS:ReserveServer(6794526866)
	TS:TeleportToPrivateServer(6794526866, code, CurrentQueue)
end

This doesn’t work?

Hold on, I’m testing this Ill tell you if it works

Ok yeah, no I just tested this this does not work, does no teleportation, and doesn’t reach the print after the teleportation

Reserve the server before looping through the players that should send them all to the same server.

1 Like

Oooo, I don’t know why I didn’t think of that Im trying this now

idk what you mean, works perfectly fine for me

THANK YOU, This fixed all of my issues

1 Like