This script is suppost to change a surface Gui background color but it doesn't and outputs out Unable to cast value to std::string Could anyone possibly fix this?
function Pad(name,color)
return script.Parent.Pads:FindFirstChild(name).BackgroundColor3 == color
end
local LetterTable = {
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
}
function Spread(color)
local number = math.random(1, 10)
Pads("A"..number, color)
Pads("B"..number, color)
Pads("C"..number, color)
Pads("D"..number, color)
Pads("E"..number, color)
Pads("F"..number, color)
Pads("G"..number, color)
Pads("H"..number, color)
Pads("I"..number, color)
Pads("J"..number, color)
end
while true do
wait(0.5)
Spread(Color.new(255, 0, 0))
end

6 comments
Color.new does not accept an RGB value from 0 to 255, instead, 0 to 1. To use a RGB value, you should use Color.fromRGB()
Still not working
It's something with Line 2
It's something with Line 2
Try use printing and see what works and what dosen't
You are using return in a function and never seeing what the function returns???