Invalid Argument #3(Color3expected, got boolean)

Hello fellow robloxians, sadly I have to go and ask for help once more on here. As the title suggest I’m getting the error “invalid Argument #3(Color3expected, got boolean)” which dosen’t really make sense to me as the stuff it’s supposed to do does work and get’s the right color I’m not finding anything related to “got boolean” on the internet as well so I’m askin for help here. Here’s the code:

game.ReplicatedStorage.GameplayUIs.Radio.update.OnClientEvent:connect(function(tbl)
		eru1.All.List:ClearAllChildren()
		for i,v in pairs(tbl) do
			local tgui = script.Unit:Clone()
			tgui.Parent = eru1.All.List
			tgui.Unit.Text = v[1].."/"..i
			tgui.ImageLabel.Image = v[3]
			tgui.Status.BackgroundColor3 = (v[2]=="S1" and Color3.fromRGB(0, 255, 0)) or (v[2]=="S2" and Color3.fromRGB(0, 195, 0)) or (v[2]=="S3" and Color3.fromRGB(226, 189, 0)) or (v[2]=="S4" and Color3.fromRGB(255, 153, 0))  or (v[2]=="S5" and Color3.fromRGB(226, 0, 255)) or (v[2]=="S6" and Color3.fromRGB(232, 0, 0)) or (v[2]=="S7" and Color3.fromRGB(85, 170, 255)) or (v[2]=="S8" and Color3.fromRGB(0, 151, 227)) or (v[2]=="S9" and Color3.fromRGB(0, 115, 173))
			tgui.Position = UDim2.new(0, 0, 0, 40*(#eru1.All.List:GetChildren() - 1))
		end
		eru1.All.List.CanvasSize = UDim2.new(0, 0, 0, 40*#eru1.All.List:GetChildren())
	end)

I really hope somebody can detect the problem and help me with getting rid of it!

If v[2] is not equal to any of the S#s, then you are setting BackgroundColor3 to false. Try having a fallback color for when it’s not any of the things you’re looking for, or just set it back to itself.

1 Like