Playerlist friend icon not working

So i have a custom playerlist and im trying to make it where if the player has a friend the player list shows an icon next to their name. but when i try to make it work it doesn’t can you help me ?

SCRIPT:

local function getFriendStatusIcon(friendStatus)
		if friendStatus == Enum.FriendStatus.Unknown or friendStatus == Enum.FriendStatus.NotFriend then
			return nil
		elseif friendStatus == Enum.FriendStatus.Friend then
			return "rbxassetid://17860532545"
		elseif friendStatus == Enum.FriendStatus.FriendRequestSent then
			return "rbxassetid://18149961956"
		elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then
			return "rbxassetid://18149961956"
		else
			error("Unknown FriendStatus: " .. friendStatus)
		end
	end

Its an older playerlist script so idk if this will still work

It wont work because all the playerlist scripts, even the old ones, are CoreGUI scripts. They have access to functions like :GetFriendStatus.

Your best bet is to use :IsFriendsWith and starterGui:GetCore(“GetBlockedUserIds”)