How can I get the userid of the tycoon owner

Hello Im having trouble with my tycoon, I want to spawn an npc but I cant get the user id of the owner
My code

local Players = game:GetService("Players")

local OwnerValue = script.Parent.Parent.Values.OwnerValue.Value

local success, friendPages = pcall(function()
	return Players:GetFriendsAsync(OwnerValue.UserId)
end)

if not success then
	-- remember to handle pcall errors
end

local function iterPageItems(pages)
	return coroutine.wrap(function()
		local pagenum = 1
		while true do
			for _, item in ipairs(pages:GetCurrentPage()) do
				coroutine.yield(item, pagenum)
			end
			if pages.IsFinished then
				break
			end
			pages:AdvanceToNextPageAsync()
			pagenum += 1
		end
	end)
end

local userIds = {}
for item, _pageNo in iterPageItems(friendPages) do
	table.insert(userIds, item.Id)
end

local randomFriend = userIds[math.random(1, #userIds)]
local HumanoidDescription = Players:GetHumanoidDescriptionFromUserId(randomFriend)

local Rig = workspace.Rig-- replace with your rig

Try return Players:GetFriendsAsync(Players:GetUserIdFromNameAsync(OwnerValue))

Hello thank you so much for your reply I tried that and my output says this
Workspace.Tycoons.Tycoon.Scripts.Script:30: Workspace.Tycoons.Tycoon.Scripts.Script:17: attempt to call missing method ‘GetCurrentPage’ of string

That means what it says it means. The pages variable that is being passed in to your function is a string, and :GetCurrentPage() is not a method of a string.

what is the pages variable supposed to be?

gets the player friend pages like you hire people in the game and the people is a random friend from the tycoon owner friends list

Print out pages and show me what it says.

do you want me to print friend pages?

Whatever pages is that’s getting passed into your iterPageItems function.