Textbox isn't changing decal

I am trying to make it so a decal ID can be inputted into the textbox so that once a button is pressed, it will display the image onto a decal part in the workspace.

After inputting the ID to the textbox, I looked at the decal ID and it was all right, the id was there. However, it didn’t put the imagine onto the decal.

Here is the code:

local textbox = script.Parent
script.Parent.FocusLost:Connect(function(enter)
	if enter then
		game.Workspace.Screen.Decal.Texture = "http://www.roblox.com/asset/?id="..textbox.Text
	end
end)

Thank you!

This should help you:

prj = "rbxthumb://type=Asset&id="..id.."&w=150&h=150"
1 Like

Roblox doesn’t use ID of the decal seen on the website for changing assets. Here’s a simple method:

  1. Drag the decal onto a part in the workspace and copy it’s id. It should be something like “rbxasset://“.
  2. When you change the decal from the script make the DecalID the new ID.

I have answered this in a previous post:

1 Like

In that post you are talking about an image label which is for a UI. I am trying to add it onto a decal which is on a part in workspace.

Just replace ImageLabel.Image with workspace.Screen.Decal.Texture and userInput with textbox.Text.

1 Like