How to check if a player has favorited?

local players = game:GetService("Players")
local char = players.LocalPlayer.Character or players.LocalPlayer.CharacterAdded:Wait()

game:GetService("AvatarEditorService"):PromptSetFavorite(game.PlaceId, 1, true)

This is my script, it works perfectly fine but the only issue is that it will still prompt even after the player has favorited.

Is there a way to check if a player has favorited without httpservice? Also do favorites actually do anything to the algorithm or nah?

2 Likes

You have to request inventory read access then use avatarEditorService:GetFavorite to do it without http service

2 Likes

Thanks brother I really appreciate it. I’ll check it out soon.

Alright so I used the method but I get this error:

Permission must be obtained with PromptAllowInventoryReadAccess before calling this method -

Oh I see the problem I’ll fix it.

One more thing, do favorites actually help the algorithm of roblox or anything?

Okay problem:

local players = game:GetService("Players")
local AES = game:GetService("AvatarEditorService")
local char = script.Parent

AES:PromptAllowInventoryReadAccess()

local Favorited = AES:GetFavorite(game.PlaceId, 1)

if not Favorited then
	AES:PromptSetFavorite(game.PlaceId, 1, true)
end

For some reason the error still shows, i’m testing this in studio if that changes anything.

Nevermind I got it to work.

I don’t know if favourite count affects it or not, but I would guess not

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.