Check if teleport request fails?

@title, is there any way to check if a teleport fails? As in when you request the teleport.

You could wrap your script inside a pcall function

local success, err = pcall function()
if err then
   print("errored")
else
   print("worked")
  end
end

can’t you use a pcall or xpcall?

You can use TeleportService | Roblox Creator Documentation

local TeleportService = game:GetService("TeleportService")

	local connection
	connection = TeleportService.TeleportInitFailed:Connect(function(player, teleportResult, errorMessage)
		if player == game.Players.LocalPlayer then
		print("Teleport failed")
		connection:Disconnect()
	end
end)
1 Like