Unable to cast value to object - TeleportService

Hello! I’m making a script which is teleporting a player back to the cafe but this error pops up:
“Unable to cast value to object”
Script:

if splits[1]:lower() == ":cafe" then
			--Teleport him back to the cafe
			local TeleportService = game:GetService("TeleportService")
			TeleportService:Teleport(5152635661, plr.UserId)
		end

This is a server script, by the way, but it should work.

The 2nd argument of TeleportService:Teleport should be a Player object, not a Player’s UserId.

3 Likes