GetRecommendedAssets
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
This function returns a list of recommendations based on the given Enum/AssetType
. Take a look at the code sample below for more information on possible usages for this function.
Data is in the format:
[ { "Item": { "AssetId": 0, "Name": "string", "Price": 0, "PremiumPrice": 0, "AbsoluteUrl": "string", "AudioUrl": "string" }, "Creator": { "CreatorId": 0, "CreatorType": "string", "Name": "string", "CreatorProfileLink": "string" }, "Product": { "Id": 0, "PriceInRobux": 0, "IsForSale": true, "IsPublicDomain": true, "IsResellable": true, "IsLimited": true, "IsLimitedUnique": true, "SerialNumber": 0, "IsRental": true, "RentalDurationInHours": 0, "BcRequirement": 0, "TotalPrivateSales": 0, "SellerId": 0, "SellerName": "string", "LowestPrivateSaleUserAssetId": 0, "IsXboxExclusiveItem": true, "OffsaleDeadline": "string", "NoPriceText": "string", "IsFree": true } } ]
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
The type of asset recommendations to retrieve recommendations for |
||
0
|
The id of an asset with a type matching the provided assetType used for context when retrieving recommendations |
Returns
Return Type | Summary |
---|---|
A list of recommendations based on the given |
Code Samples
Getting a Hat Recommendation
This will return a list of similar hats much like how similar assets are displayed when viewing the catalog page on the website. The contextAssetId is optional and if not provided it will return some popular items from that category.
local assets = AvatarEditorService:GetRecommendedAssets(Enum.AvatarAssetType.Hat, 9255093)