I’m making a game where players are able to enter any decal ID to display an image of their choosing on a brick. It is very important to the game’s purpose that this image is clearly visible and of a high detail - so I do not think a 420x420 image will work for this, so I don’t want to resort to using asset thumbnail.
I tried initially entering decal ID, without realising that this wouldn’t work. Next I tried using insert service, and getting the texture - but I got the error ‘Asset not trusted for this place’.
I’m a bit lost in how I can achieve what I want now, could someone help me?
I have decided to settle for having a 420x420 thumbnail if a decal ID has been entered, but if a user has entered an image ID directly then allow the user to use the image ID entered.
I don’t think there is any other solution to this, but I wonder if ROBLOX could change this - seems a bit silly to not trust decals, but trust images, when you can get the thumbnail (even though of lesser quality), or you can just paste any decal into studio and get the image ID, then use it in the same way in my game.
It just ends up being a hurdle that can be bypassed, but give worse quality?
The best method, although hacky, I can think of is by subtracting the decal’s ID by 1, then use GetProductInfo to find if it is the image correlating with the decal. You will have to subtract 1 every time until you get the image and it may take a while to get it:
local mps = game:GetService("MarketplaceService")
local decalInfo = mps:GetProductInfo(decalId)
local ID = tonumber(decalInfo:match("%d+"))
for i = ID - 10, ID + 1 do
local info = mps:GetProductInfo(i)
if info.Creator.Name == decalInfo.Creator.Name and info.Name == decalInfo.Name and info.AssetTypeId == 1 then
print(i) -- found the image
end
end
Sorry for the necropost, but this solution seems to’ve been included inside Basic Admin’s donor cape command. Enter in a decal ID and it will convert it into an image. Very great idea, thanks!