I am trying to generate a random decal by generating a random asset id and putting it into a decal. However, the image is only a decal 10% of the time due to the id usually being something like a mesh or a model. And there's no way to check if the asset id generated is a decal from my knowledge...
COMMUNITY QUESTION
Generate A Random Decal?
1 answer
Try this:
local mas = game:GetService("MarketplaceService")
function generate()
local num = math.random(1,99999999)
local data = mas:GetProductInfo(num)
local array = {
Number = num;
IsADecal = (data.AssetTypeId) == 13;
}
return array
end
--Example
local a = generate()
print(a.Number,a.IsADecal)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Ty