Decal Not Changing

Anytime, I try to run the script, the image doesn’t show the image inputted, it shows nothing, not even the preset image included.

I wan’t it to change to the image inputted.

I’m unsure on how to fix this

local Prefix = "https://www.roblox.com/asset/?id="
---
local HexaID = "16059181918"
local NoClippedID = "16059264307"
local IconID = "16059281590"
local ContentDeletedID = "16059328826"
local BlackID = "16059352786"
local DoorID = "16059393321"
local bID = "16059453149"
----
local PaintingID = "" -- Editable
----
local PaintingVisible = script.Parent:WaitForChild("Painting"):WaitForChild("Decal")

-- Code
local PaintingChoose = math.random(1,7)

if PaintingChoose == 1 then
	PaintingVisible.Texture = Prefix..HexaID
elseif PaintingChoose == 2 then
	PaintingVisible.Texture = Prefix..NoClippedID
elseif PaintingChoose == 3 then
	PaintingVisible.Texture = Prefix..IconID
elseif PaintingChoose == 4 then
	PaintingVisible.Texture = Prefix..ContentDeletedID
elseif PaintingChoose == 5 then
	PaintingVisible.Texture = Prefix..BlackID
elseif PaintingChoose == 6 then
	PaintingVisible.Texture = Prefix..DoorID
elseif PaintingChoose == 7 then
	PaintingVisible.Texture = Prefix..bID
end
1 Like

I believe it’s because the “Prefix” is incorrect. Try using “rbxassetid://” in place of “https://www.roblox.com/asset/?id=”. If that doesn’t work, I suggest you try it with decal image ids instead of decal ids. Hope this helps.

1 Like

“rbxassetid://” doesn’t work, I’ll try the other system you told me to use


Hi WaflSyrup

Try using the prefix http://www.roblox.com/asset/?id= maybe? Pretty sure decals use http and not https

According to the post regarding assets, both http and https work

Alright I’ve done some testing with your code and I think you’re using image Ids for decals or vice versa, because when I used the image Id it worked

As an example, the code uses the Id 16059181918 for the Hexa painting and it doesn’t work; but 16059181882 does

1 Like

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