To put it simply, I want to randomize a decal when it is not shown. I have an external script which shows the decal when needed. But with the script I have which randomizes the decal itself, I am getting an error. The error is as follows:
“Players.GodzillaGamer1954.PlayerGui.StatusUI.BloodSplatter.LocalScript:14: invalid argument #2 to ‘random’ (interval is empty)”
Here’s the script the error is referring to:
Script
--Variables
local blood = script.Parent
--Tables
local splatters = {
splatter1 = {ID = 409191497, Size = {1.05, 0},{1.5, 0}},
splatter2 = {ID = 400462004, Size = {1.05, 0},{1.75, 0}},
splatter3 = {ID = 246162648, Size = {1.05, 0},{1.5, 0}}
}
--Loops
while true do
if blood.ImageTransparency == 1 then
local value = math.random(1,#splatters)
local picked_value = splatters[value]
blood.Image = picked_value.ID
blood.Size = picked_value.Size
end
wait()
end
I am also unsure if the actual image link and size will change when it says so.
How would I make this script work?