How can I translate a URL to an AssetId?

My function returns:

Now the number is right, but I want it like this:


Can anyone point me in the right direction to find out how to use this?
Also if you must know I’m using:

local IconID = Details.EmblemUrl

1 Like

The url that your function returns should work fine. But, for the purpose that you are looking for, this is what I recommend.

You need to first get the ID from the url. To do this, use string.find to find the position of the equal sign, then string.sub to remove everything but the ID.

local url = ""
local ID = string.sub(url, string.find(url,"=")+1, string.len(url))

Then, you need to make the new URL

local newURL = "rbxassetid://"..ID

i dont have experience with URL Stuff but try this

Mesh.AssetId ==
--Maybe roblox automatically fix it they do it in the studio

it may not work

1 Like

That works with meshes but I should’ve specified about ImageLabels, Thanks for your response.

It works! Thank you for the explanation aswell.

1 Like