How do i convert decal ID to image ID using scripts?

hello, i’ve noticed that everytime i use a decal ID using scripts it doesn’t get converted into image ID like how manually entering a decal ID into the Textures box.

for example, if you use this decal ID “6673968185” this won’t display anything because the actual image ID is “6673967738” (through scripts)

what can i do to solve this?

-- local
local button = script.Parent
local RE = game.ReplicatedStorage.RemoteEvent

local function dosomething(name, text)
	local text = script.Parent.Parent.Parent.Frame2.TextBox.Text
	print("sending signal")
	print(text)
	RE:FireServer(text)
	wait(3)
end

button.Activated:Connect(dosomething)

-- server
local RE = game.ReplicatedStorage.RemoteEvent
local TVdecal = game.Workspace.TV.DecalPart.Decal
RE.OnServerEvent:Connect(function(name, text)
	print(text)
	print("giving decal")
	local thing= tostring(text)
	print(thing)
	TVdecal.Texture = "http://www.roblox.com/asset/?id="..thing
end)
1 Like

Maybe you can insert the decal using InsertService, and after you grab the image id, you delete the decal

Sorry, ignore this. Didn’t realise the plugin was 4000 robux…

Maybe look into the code from this plugin to see how it does it? But first, maybe test the plugin first to make sure it gives the right details.

Imiji - convert decal IDs to image IDs

Never ran into this … but I did find a few things about it.
Is this something that works out for you?

local decalId = "6673968185"
local insertService = game:GetService("InsertService")
local success, decalInfo = pcall(function()
    return insertService:GetProductInfo(decalId)
end)

if success and decalInfo.AssetId then
    local imageId = "rbxassetid://" .. decalInfo.AssetId
    print("Image ID:", imageId)
else
    print("Failed to retrieve decal info for ID:", decalId)
end

Failed to retrieve decal info for ID: 6673968185

permissions are all enabled

I’m not sure what you’re doing and really have nothing to test.

seems like i fixed it, needed to add this to the end of the string “&width=420&height=420&format=png”

local RE = game.ReplicatedStorage.RemoteEvent
local TVdecal = game.Workspace.TV.DecalPart.Decal
RE.OnServerEvent:Connect(function(name, text)
	print(text)
	print("giving decal")
	local thing= tostring(text)
	print(thing)
	TVdecal.Texture = "https://www.roblox.com/asset-thumbnail/image?assetId="..thing.."&width=420&height=420&format=png"
end)

Nice … now that you showed that I have saw that before. With player pics.

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