function TeleportServiceUtils.promiseTeleport(M,o,I)assert(type(M)=="\110\117\109\098\101\114","\066\097\100 \112\108\097\099\101\073\100")assert(type(o)=="\116\097\098\108\101","\066\097\100 \112\108\097\121\101\114\115")assert(typeof(I)=="\073\110\115\116\097\110\099\101"and I:IsA("\084\101\108\101\112\111\114\116\079\112\116\105\111\110\115")or I==nil,"\066\097\100 \111\112\116\105\111\110\115")return Promise.spawn(function(l,U)local Y local D,t=pcall(function()Y=TeleportService:TeleportAsync(M,o,I)end)if not D then return U(t)end return l(Y)end)end return TeleportServiceUtils

function TeleportServiceUtils.promiseTeleport(placeId, players, teleportOptions)
	assert(type(placeId) == "number", "Bad placeId")
	assert(type(players) == "table", "Bad players")
	assert(typeof(teleportOptions) == "Instance" and teleportOptions:IsA("TeleportOptions") or teleportOptions == nil, "Bad options")

	return Promise.spawn(function(resolve, reject)
		local teleportAsyncResult
		local ok, err = pcall(function()
			teleportAsyncResult = TeleportService:TeleportAsync(placeId, players, teleportOptions)
		end)
		if not ok then
			return reject(err)
		end

		return resolve(teleportAsyncResult)
	end)
end

return TeleportServiceUtils
