I want to check whether a GUI I have has a certain background colour, but I tried to use color3 but it doesn't seem to work. If anyone could tell me something that I am doing wrong, that would be great. Here is my code:
1 | for i,v in pairs (foodCatagories) do |
2 | v.MouseButton 1 Click:Connect( function () |
3 | if v.BackgroundColor 3 = = Color 3 ( 0 , 255 , 255 ) then |
4 | print ( "Hello" ) |
5 | end |
6 | end ) |
7 | end |
What IceAndNull said is correct, but for GUI elements you wan't to use Color3.FromRGB() so
if v.BackgroundColor3 == Color3.fromRGB(0,255,255) then
Instead of using Color3(0,255,255)
it’s Color3.new(0,255,255)
Edit: as kaspar1230 pointed out, use Color3.fromRGB(0,255,255)
instead of Color3.new()