Script isn't detecting if an item is limited or not

Hi, developers!

I’m currently working on this UGC marketplace area and I’m creating these auto-updating podiums, which sounds cool and all but comes with its problems. I’m trying to make the system detect if an item is limited, then enable a few UI elements to show that it’s limited, as seen here:
image
The only problem is that the elements don’t actually appear when the item is limited at all. Here’s my code:

if itemInfo.IsLimitedUnique or itemInfo.IsLimited == true then
				limitedTag.Visible = true
				remaining.Visible = true
				remaining.Text = 'Remaining: '..tostring(itemInfo.Remaining)..' / '..tostring(stock)
			else
				limitedTag.Visible = false
				remaining.Visible = false
			end

And now, despite the item being a limited, it still won’t work…

image

Any help would be hugely appreciated, sorry for all of the images!!

(Note: There are no errors in the output)

1 Like

Could you show more of the code? Especially the part where you grab the data.

Its probably best to debug that GetProductInfo is actually marking the item as Limited, might behave weirdly with UGC items because Roblox:tm:

EDIT

This does work but its probably not doing what you think it does.

a or b == true is checking that a is a non-falsey value (false/nil) or that b equals true. It does not check if a or b equals true. The correct statement here would either be simply if a or b then or if a == true or b == true then

1 Like
local assetID_s = part:GetAttribute('AssetID')
		local itemInfo = mService:GetProductInfo(assetID_s, Enum.InfoType.Asset)

Here’s where the item data is collected. Let me know if you need more!

Hi, just implemented your suggestion but it doesn’t look like I’m getting a different result.
image

image

ahem. Run the GetProductInfo call in the command bar or something idk?

Yeah, just checked in the prints and its showing that the item is not limited or limited unique. I guess that solves my problem…

Thanks for the help!

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