Cant teleport players to a single player private server successfully

Hey devforum! I seem to be having an issue where the success rates of my teleport script are really low, i was wondering if theres a way to fix this or if theres a more efficient way to script this?

What is the issue: when i call the teleport event on a player after the loading screen, the teleport takes 1+ minute to fully work or most of the time just throws a teleport error on screen after waiting the long 1-2 min wait:

What solutions have I tried so far: Ive tried changing teleport methods in the script, but both still gave errors.

Heres the link to the game if you want to test it out: REALMS of roblox [ALPHA] - Roblox

below is the code for my teleport handler, and yes ive already checked that the place ID is correct.

local TeleportEvent = game.ReplicatedStorage.TeleEvent
local TPS = game:GetService("TeleportService")
local ServerStorage = game:GetService("ServerStorage")

TeleportEvent.OnServerEvent:Connect(function(plr)
	local Players = {}
	table.insert(Players,plr)
	local PrivateServerCode = TPS:ReserveServer(16740888388)
	
	TPS:TeleportToPrivateServer(16740888388, PrivateServerCode, Players)
	table.clear(Players)
end)

Possible causations of this problem:

  • I may have scripted something wrong in the script, if so then please let me know!

  • The place being teleported to is massive and may take time to prepare in the servers:
    image

  • It may be something to do with the fact ive limited the server capacity im teleporting the player to at 1 max plr. But im not sure.

Thanks for the help - FastTheDev

1 Like

Thats a lot of voxels, especially for the server, rather than loading it all at once, you load it on the client. or create a system to load it in based on where you are on the map using the client.

Keep in mind that this is 1.8 Billion voxels being rendered at a time, and the recommended maximum you should have is below 900 Million voxels, which is probably why your game is so slow.

How would i get the terrain to load in chunks though? Is there a way to manage the loading for terrain via a script?