[SOLVED] Decals not appearing/loading

local RandomizedTable = {
	Rain = {1, 0, 2, RainID.Texture, ActualRain}, -- RainID is the decal
	Fire = {2, 0, 2, FireID.Texture, ActualFire} -- FireID is the decal
}

function GenerateDigit1()
	local RandomRange = math.random(0, 9)
	local RandomImage = math.random(1, 2)

	RandomDigit1.Value = tostring(RandomRange)

	for Key, Value in pairs(RandomizedTable) do
		if Key[1] == RandomImage and Key[2] <= Key[3] then
			Key[2] += 1
			Image1.Decal.Texture = Key[4]
			CombinationItems.Digit1.Value = RandomDigit1.Value
			Key[5].Parent = CombinationItems
		end
	end
end

task.wait()
GenerateDigit1()

I want this script to get the decal’s texture, and put it on a part. It works great apart from the decal not appearing when I test the game.

I don’t know a lot about decals, so any help is appreciated!!

did you forget to put rbxassetid://

1 Like

The RainID.Texture already implies that there is rbxassetid:// because RainID is a decal, and .Texture gets the id that already has rbxassetid.//.

So, short answer is no, I didn’t forget, I checked workspace and it has rbxassetid:// I’m not sure why it’s not appearing in my game once I test though…

Even when I do this:

local RainID = "rbxassetid://12611686796" --  This Changed
local FireID = "rbxassetid://12611690653" -- This Changed

local RandomizedTable = {
	Rain = {1, 0, 2, RainID, ActualRain}, --RandomImage, Pick, HowMany, ImageID, ObjectName
	Fire = {2, 0, 2, FireID, ActualFire}
}

function GenerateDigit1()
	local RandomRange = math.random(0, 9)
	local RandomImage = math.random(1, 2)

	RandomDigit1.Value = tostring(RandomRange)

	for Key, Value in pairs(RandomizedTable) do
		if Key[1] == RandomImage and Key[2] <= Key[3] then
			Key[2] += 1
			Image1.Decal.Texture = Key[4]
			CombinationItems.Digit1.Value = RandomDigit1.Value -- Change Per Digit
			Key[5].Parent = CombinationItems
		end
	end
end

task.wait()
GenerateDigit1()

It doesn’t appear on the part. Why is that?

You have to preload the assets… maybe?

1 Like

Omg! I’m so dumb… I needed to switch all the Key[1], Key[2], etc. to Value[1], Value[2], etc.

Thank you for your help though!

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