I made a script that onClick player clicks the gui, then the gui should change colors but when i checked it has 5100,5100,5100 black color heres the script: It just doesn't change to the wanted colors i chosen it changes to gray
function onClick() wait(.1) script.Parent.Parent.ImageColor3 = Color3.new(122, 36, 38) wait(.2) script.Parent.Parent.ImageColor3 = Color3.new(200, 59, 63) end script.Parent.MouseButton1Click:connect(onClick)
what is wrong ???
i tried with localscript and script, both didn't work and happened the same...
When using Color3, it works on a range of 0-1, rather than the expected 0-255. What you need to do is divide the number by 255 so:
function onClick() wait(.1) script.Parent.Parent.ImageColor3 = Color3.new(122/255, 36/255, 38/255) wait(.2) script.Parent.Parent.ImageColor3 = Color3.new(200/255, 59/255, 63/255) end script.Parent.MouseButton1Click:connect(onClick)