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:
for i,v in pairs(foodCatagories) do v.MouseButton1Click:Connect(function() if v.BackgroundColor3 == Color3(0,255,255) then print("Hello") end end) 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()