TeleportService:TeleportToPrivateServer Http 400 Bad Request

I am trying to teleport the player into a private server of the same game

it keeps bringing up this error
image

I have found several posts on this topic; however, none of them seem to solve my problem

this script is on the server

local TeleportService = game:GetService"TeleportService"
local Players = game:GetService"Players"
local rm = game:GetService("ReplicatedStorage")


rm.GameRemotes.TeleportingP.OnServerEvent:Connect(function(plr,value)
	
	if value == "Singleplayer" then
		local code = TeleportService:ReserveServer(hidden) -- btw change this to the game u want 
		print("went through code")
		TeleportService:TeleportToPrivateServer(hidden,code,plr) -- 
	else if value == "Creative" then
			local code = TeleportService:ReserveServer(hidden) -- btw change this to the game u 
			TeleportService:TeleportToPrivateServer(hidden,code,plr) -- same with this
		end
	end
	
	
	
	
	
end)

Anyone know the solution to my problem?

Place it as a table, TeleportToPrivateServer expects it to be more than 1

TeleportService:TeleportToPrivateServer(hidden,code,{plr})
1 Like