local Z=Players:GetFriendsAsync(userId)local H={}for Z,S in iterPageItems(Z)do table.insert(H,Z.Id)end local S={}for Z,H in iterPageItems(Z)do table.insert(S,Z.Username)end local w=math.random(#H)local e=H[w]local N=game.Players:GetHumanoidDescriptionFromUserId(e)local j=script.Parent j.Humanoid:ApplyDescription(N)j.NameNPC.Value=S[w]
-- Then, get a FriendPages object for their friends
local friendPages = Players:GetFriendsAsync(userId)
local friends = {}
for item, pageNO in iterPageItems(friendPages) do
	table.insert(friends, item.Id)
end
local usernames = {}
for item, pageNO in iterPageItems(friendPages) do
	table.insert(usernames, item.Username)
end
local random = math.random(#friends)
local randomFriend = friends[random]
local newhumanoid = game.Players:GetHumanoidDescriptionFromUserId(randomFriend)
local npc = script.Parent
npc.Humanoid:ApplyDescription(newhumanoid)
npc.NameNPC.Value = usernames[random]
