Unable to cast string to int64?

I tested your code, I just disabled the surface gui stuff. I added a model, placed a “gate” so those functions are connected.
Added variables missing, like placeId, list, etc.
The code works normally, I got teleported to a reserved server.
You can enable again all those lines I disabled, those make no difference in the teleport, and change the placeId to your place id of course.
If the code still not working for you, its a different reason and not the script. (like you dont have rights to create a reserved server of that place id)

Actually I got a weird issue… I created a new file, I placed your code, I created a new place inside the game (never opened that place) then I went to test ingame and I got the same error 733… I tried a couple of times and it was the same… I went to the game file, opened the new place I created (by first time), published to roblox, and suddenly the Teleport started to work. If the place id that you are using is inside your game, and you never opened the place, maybe that could be the problem, it was for me…

local TS = game:GetService("TeleportService")

local list = {}
local teleporting = false
local placeId = 0000000

local function updateGui()
	--billboard.Frame.players.Text = "Players: " ..#list.. "/5" -- Change the number 16 according to the Max Player who want to be teleported.
	--billboard2.Frame.players.Text = "Players: " ..#list.. "/5"
end

local function removeFromList(character)
	for i=1,#list do
		if list[i] == character.Name then
			table.remove(list,i)
			updateGui()
		end
	end
end

local function teleportPlayers()
	if #list > 0 then
		--billboard.Frame.Status.Text = "TELEPORTING"
		--billboard.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
		--billboard2.Frame.Status.Text = "TELEPORTING"
		--billboard2.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
		local playersToTeleport = {}
		local teleportTime = 0
		for i=1,#list do
			if game.Players:findFirstChild(list[i]) then
				table.insert(playersToTeleport,game.Players:findFirstChild(list[i]))
				--TransitionEvent:FireClient(game.Players:findFirstChild(list[i]))
			else
				table.remove(list,i)	
			end
		end 
		local code = TS:ReserveServer(placeId)
		warn("Server Password:", code)
		teleporting = true
		TS:TeleportToPrivateServer(placeId,code,playersToTeleport)
		--repeat wait() until #list <= 0
		--billboard.Frame.Status.Text = "READY"
		--billboard.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
		--billboard2.Frame.Status.Text = "READY"
		--billboard2.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
		teleporting = false
	end
end

script.Parent.Gate.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if teleporting == false then
			local char = hit.Parent
			local player = game.Players:FindFirstChild(char.Name)
			local alreadyExists = false

			for i=1,#list do
				if list[i] == char.Name then
					alreadyExists = true
				end
			end

			if alreadyExists == false then
				if #list < 2 then -- Many Players have been teleported.
					warn("adding a player to TP list")
					table.insert(list,char.Name)
					--char.PrimaryPart.CFrame = spawnTeleport.CFrame
					updateGui()
					--leaveGuiEvent:FireClient(player)
				end

				player.CharacterRemoving:connect(function(character)
					removeFromList(character)
				end)
			end
		end
	end
end)

--[[
leaveGuiEvent.OnServerEvent:Connect(function(player)
	if player.Character then
		player.Character.HumanoidRootPart.Anchored = false
		wait()
		player.Character.Humanoid.Jump = true
		wait()
		player.Character:MoveTo(game.Workspace.leaveRoomPart.Position)
		removeFromList(player.Character)
	end
end)
]]

while wait() do
	timer = 15 -- Wait time before teleport change to whawtever you want it to be
	for i=1,timer do
		warn(i)
		timer = timer - 1
		--billboard.Frame.time.Text = timer
		--billboard2.Frame.time.Text = timer
		wait(1)
	end
	teleportPlayers()
end

So this code works?
omgwhy30characterss

Yup, worked normally for me, I got teleported to a reserved server without problems (except for the weird issue I told you about)

image
NVM, they seem to work again, just forgot a bit of spaces!

1 Like

Yup, you should enable all the lines I commented-out. All those lines are for the User Interface of the teleports and ClientSide remotes.

I was not going to add the billboards etc to test the “visuals” the important thing was the teleporting.
Just enable again all the lines and should still working

Would there be another way to fix error 733? or is changing the code the only way?

I still dont know why you got the error 733…
And the changes I made to your script was only adding some variables missing, like

local list = {}
local teleporting = false
local placeId = 00000000

But maybe you already had them before…

So, the error 733 still happening when trying to teleport?

unfortunately, yeah
image

Is there a way to make a subplace public or something? Cuz if you can, that might be the issue.

I’ve been working a lot with Teleports to Reserved Servers, I prefer to use TeleportAsync() with TeleportOptions. But I used TeleportToPrivateServer() many times in the past (probably thats not the issue, but, its a good practice to use TeleportAsync() instead of the TeleportToPrivateServer()).
Im 100% sure that you can teleport to reserved servers no matter if they are public or private. Actually I never work on public servers, only private ones, nobody allowed. So thats not the reason for the error

This is an annoying question, but are u totally sure you have rights for the place you are trying to teleport the players? its a place inside your game file?

image
yes, i have been trying to teleport players to the place named sublevel 1.

And another annoying question, you sure you are using the correct place id of Sublevel1 place? (Right click the place and copy the place id)

yes! It was the exact same correct id!

1 Like

OP did let me join the game that was not allowing a reserved server teleport.

I found a weird issue/bug. The scripts were correct, but the Reserved Teleport was not working.
After perform a normal Teleport with TeleportService:Teleport(placeID, player) the issue with Reserved Teleport got fix…
Like, game file was not recognizing the existance of that subPlace inside game file. Its fixed in game now.

idk if this is a bug or something…
@Bug-Support