so im working on an addon and i dont get what this error means
[CODE]
[ERROR] lua/includes/util/color.lua:16: bad argument #1 to 'min' (number expected, got nil)
1. min - [C]:-1
2. Color - lua/includes/util/color.lua:16
3. unknown - addons/admin-report/lua/autorun/cl_adminreport.lua:36
[/CODE]
this is in the config
[CODE]
BoxColorAR = 0, 160, 255 -- The default color was 0, 160, 255
[/CODE]
and this is in the Client file
[CODE]
function Frame:Paint ( w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color(BoxColorAR))
end
[/CODE]
Please help! <3 , and facepunch if i posted in wrong section please dont ban me! <3
[QUOTE=WilliamAtSky;47715850]so im working on an addon and i dont get what this error means
[CODE]
[ERROR] lua/includes/util/color.lua:16: bad argument #1 to 'min' (number expected, got nil)
1. min - [C]:-1
2. Color - lua/includes/util/color.lua:16
3. unknown - addons/admin-report/lua/autorun/cl_adminreport.lua:36
[/CODE]
this is in the config
[CODE]
BoxColorAR = 0, 160, 255 -- The default color was 0, 160, 255
[/CODE]
and this is in the Client file
[CODE]
function Frame:Paint ( w, h )
draw.RoundedBox( 4, 0, 0, w, h, Color(BoxColorAR))
end
[/CODE]
Please help! <3 , and facepunch if i posted in wrong section please dont ban me! <3[/QUOTE]
I think you are setting the value BoxColorAR with 3 different values.
You can do that if you are doing like
[CODE]
r, g, b = 0, 160, 255
[/CODE]
And it will set all the numbers.
But you did:
BoxColorAR = 0 ->
BoxColorAR = 160 ->
BoxColorAR = 255.
So what you put in to the Color() is 255 but it needs atleast 3 values.
You could do
[CODE]
BoxColorAR = Color( 0, 160, 255 )
[/CODE]
and then change the Frame:Paint to
[CODE]
function Frame:Paint ( w, h )
draw.RoundedBox( 4, 0, 0, w, h, BoxColorAR)
end
[/CODE]
I only changed there the Color(BoxColorAR) -> BoxColorAR.
Thanks! Love from Sweden
Sorry, you need to Log In to post a reply to this thread.