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!!
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…
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()