TeleportService by using RemoteFunction returns as fail although values properly pull

StarterGui:

ReplicatedStorage.RealmSystem.OnClientEvent:Connect(function(RealmID)
	if Teleport == false then
		Teleport = true
		FadeInBackground:Play()
		FadeInBackground.Completed:Wait()
		SizeOutLogo:Play()
		SizeOutLogo.Completed:Wait()
		local result = ReplicatedStorage:FindFirstChild("TeleportationSystem"):InvokeServer(RealmID)
		print(result)
	end
end)

ServerScriptService:

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

ReplicatedStorage.TeleportationSystem.OnServerInvoke = function(player,ID)
	print(player.Name,ID)
	local success,fail = pcall(function()
		TeleportService:Teleport(player,ID)
	end)
	if not success then
		return "Error"
	end
end


image

If you look at the Teleport page, the placeId of the place you want to teleport to should come before the player. (On your “teleport” line)

Switching those two values around should fix the issue.

1 Like