How can I reliably insert decal ID’s into a decal object?
example of my problem:
i enter a valid decal ID via a script, and it sets the decal’s ID to that number, yet nothing shows up.
when i normally paste the image ID into the decal Texture, it changes the ID very slightly.
how can I make it reliable?
Scottifly
(Scottifly)
October 2, 2021, 4:28am
#2
no, they’re not happening to me. I’m looking into my issue right now.
7z99
(cody)
October 2, 2021, 4:32am
#4
Are you using the rbxassetid:// prefix?
no, should i be using that prefix?
7z99
(cody)
October 2, 2021, 4:40am
#6
Yeah, just do decal.Texture = 'rbxassetid://'..imageId
The issue with that is:
that definitively sets an asset id.
roblox’s decal system sucks, so it will change it slightly when entering it manually.
i need the decal to correct when entered via script. is there a good way to do this?
7z99
(cody)
October 2, 2021, 4:42am
#8
I’m not sure what you mean, the id shouldn’t change if it’s a valid decal
https://i.gyazo.com/025b84ea9e8d3662df4fc07cad70b3a4.mp4
take a look at the last few digits of the decal ID before AND after i enter it.
^^this is the ID i entered.
7z99
(cody)
October 2, 2021, 4:44am
#11
Oh I see, not sure why that’s happening but my guess is that it probably has to do with how assets are delivered, try typing in “rbxassetid://7422642815”
7z99
(cody)
October 2, 2021, 4:56am
#13
Ah okay, I just tried it out now. That’s weird.
I did a bit of research and came across this post:
Request fail throws if you supply an invalid asset id through that link. Library ids are not the same as image ids, so you will have to find a method of converting that into the proper asset id.
You can use the rbxthumb ContentId to help in this process. This’ll fetch the thumbnail of the image without having to do any subtraction tricks. I do believe the thumbnail differs from the actual image asset though so you’ll need to figure that bit out on your own.
Texture = "rbxthumb://type=Asset&id=…
So basically,
local id = 7422642815
decal.Texture = 'rbxthumb://type=Asset&id='..id..'&w=420&h=420'
That worked for me.
7z99:
7422642815
you, my man, are a life saver. you earned this solution. thanks!
1 Like