AngrySolveddraw****undedBox not accepting value. Making a menu that changes color.

Posts 1–13 of 13 · Page 1 of 1
draw****undedBox not accepting value. Making a menu that changes color.
So i'm making a derma menu that uses DColorMixer to change the menu's color, the derma menu also uses draw****undedBox but when ever I grab the values from the DColorMixer and input it into the color argument its gives me "attempt to index global 'color' (a nil value)." Im even making sure that it's not a nil value. Heres some proof.

Any help?
Quote Originally Posted by Jimmy Cumberbatch View Post
So i'm making a derma menu that uses DColorMixer to change the menu's color, the derma menu also uses draw****undedBox but when ever I grab the values from the DColorMixer and input it into the color argument its gives me "attempt to index global 'color' (a nil value)." Im even making sure that it's not a nil value. Heres some proof.

Any help?
Replace draw****undedBox with draw****undedBox to fix the error.
Code:
function menu()
	local derma = vgui.Create( "DFrame" )
		derma:SetSize( 250, 250 );
		derma:SetPos( 500, 500 );
		derma:SetTitle( "Menu Color" );
		derma:SetVisible( true );
		derma:SetDraggable( true );
		derma:ShowCloseButton( true );
		derma:MakePopup()
		
		function derma.Paint()
		draw****undedBox( 2, 0, 1, derma:GetWide(), derma:GetTall(), Color(0,30,0) )
		end
	
	local colorpicker = vgui.Create ( "DColorMixer" )
		colorpicker:SetParent( derma )
		colorpicker:Dock( FILL )
		colorpicker:SetPalette( true )
		colorpicker:SetAlphaBar( true )
		colorpicker:SetWangs( true )
		colorpicker.ValueChanged = function( self, color )
		
		local thecolor = print(color.r, color.g, color.b, color.a)
		
		hook.Add("HUDPaint", "getmodel", function()
		draw.DrawText(color.r.." ".. color.g.. " ".. color.b.. " ".. color.a, "TargetID", ScrW() / 2, ScrH() / 2, Color(255,0,0), TEXT_ALIGN_CENTER)
		end)
		
	end
end
any ideas?
Quote Originally Posted by Jimmy Cumberbatch View Post
Code:
function menu()
	local derma = vgui.Create( "DFrame" )
		derma:SetSize( 250, 250 );
		derma:SetPos( 500, 500 );
		derma:SetTitle( "Menu Color" );
		derma:SetVisible( true );
		derma:SetDraggable( true );
		derma:ShowCloseButton( true );
		derma:MakePopup()
		
		function derma.Paint()
		draw****undedBox( 2, 0, 1, derma:GetWide(), derma:GetTall(), Color(0,30,0) )
		end
	
	local colorpicker = vgui.Create ( "DColorMixer" )
		colorpicker:SetParent( derma )
		colorpicker:Dock( FILL )
		colorpicker:SetPalette( true )
		colorpicker:SetAlphaBar( true )
		colorpicker:SetWangs( true )
		colorpicker.ValueChanged = function( self, color )
		
		local thecolor = print(color.r, color.g, color.b, color.a)
		
		hook.Add("HUDPaint", "getmodel", function()
		draw.DrawText(color.r.." ".. color.g.. " ".. color.b.. " ".. color.a, "TargetID", ScrW() / 2, ScrH() / 2, Color(255,0,0), TEXT_ALIGN_CENTER)
		end)
		
	end
end
any ideas?
working fine for me

0 0 0 255
5 0 0 255
7 0 0 255
8 0 0 255
12 0 0 255
17 0 0 255
23 1 1 255
26 2 2 255
35 4 4 255
44 7 7 255
53 10 10 255
60 13 13 255
76 21 21 255
85 27 27 255
99 37 37 255
116 52 52 255
127 63 63 255
143 80 80 255
159 98 98 255
175 118 118 255
196 146 146 255
214 171 171 255
230 197 197 255
247 226 226 255
255 242 242 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
Quote Originally Posted by D3M0L1T10N View Post
working fine for me

0 0 0 255
5 0 0 255
7 0 0 255
8 0 0 255
12 0 0 255
17 0 0 255
23 1 1 255
26 2 2 255
35 4 4 255
44 7 7 255
53 10 10 255
60 13 13 255
76 21 21 255
85 27 27 255
99 37 37 255
116 52 52 255
127 63 63 255
143 80 80 255
159 98 98 255
175 118 118 255
196 146 146 255
214 171 171 255
230 197 197 255
247 226 226 255
255 242 242 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
255 255 255 255
that was just a test to see if the values were nil or they were there. I want to use those numbers to input it into this line of code
Code:
draw****undedBox( 2, 0, 1, derma:GetWide(), derma:GetTall(), Color(0,30,0) )<--input it into the Color argument with color.r, color.g, color.b
but when I do input it, it tells me the color is a nil value.
use this it changes colors Color(CurTime()*30 % 240, CurTime()*30 % 248, CurTime()*30 % 255)
im sorry but i thought you ment you want the menu to change color by itself
Quote Originally Posted by ilikepan View Post
use this it changes colors Color(CurTime()*30 % 240, CurTime()*30 % 248, CurTime()*30 % 255)
im sorry but i thought you ment you want the menu to change color by itself
that's pretty cool but I want it to use the DColorMixer to change colors instead of changing colors randomly.
yup well im gonna work on JumpMan.lua
Quote Originally Posted by Jimmy Cumberbatch View Post
Any ideas???
Code:
function menu()
	local gcolor = Color( 0, 30, 0 )
	
	local derma = vgui.Create( "DFrame" )
		derma:SetSize( 250, 250 );
		derma:SetPos( 500, 500 );
		derma:SetTitle( "Menu Color" );
		derma:SetVisible( true );
		derma:SetDraggable( true );
		derma:ShowCloseButton( true );
		derma:MakePopup()
		
		function derma.Paint()
		draw****undedBox( 2, 0, 1, derma:GetWide(), derma:GetTall(), gcolor )
		end
	
	local colorpicker = vgui.Create ( "DColorMixer" )
		colorpicker:SetParent( derma )
		colorpicker:Dock( FILL )
		colorpicker:SetPalette( true )
		colorpicker:SetAlphaBar( true )
		colorpicker:SetWangs( true )
		colorpicker.ValueChanged = function( self, color )
		gcolor = color
		
		local thecolor = print(color.r, color.g, color.b, color.a)
		
		hook.Add("HUDPaint", "getmodel", function()
		draw.DrawText(color.r.." ".. color.g.. " ".. color.b.. " ".. color.a, "TargetID", ScrW() / 2, ScrH() / 2, Color(255,0,0), TEXT_ALIGN_CENTER)
		end)
		
	end
end

menu()
Quote Originally Posted by D3M0L1T10N View Post
Code:
function menu()
	local gcolor = Color( 0, 30, 0 )
	
	local derma = vgui.Create( "DFrame" )
		derma:SetSize( 250, 250 );
		derma:SetPos( 500, 500 );
		derma:SetTitle( "Menu Color" );
		derma:SetVisible( true );
		derma:SetDraggable( true );
		derma:ShowCloseButton( true );
		derma:MakePopup()
		
		function derma.Paint()
		draw****undedBox( 2, 0, 1, derma:GetWide(), derma:GetTall(), gcolor )
		end
	
	local colorpicker = vgui.Create ( "DColorMixer" )
		colorpicker:SetParent( derma )
		colorpicker:Dock( FILL )
		colorpicker:SetPalette( true )
		colorpicker:SetAlphaBar( true )
		colorpicker:SetWangs( true )
		colorpicker.ValueChanged = function( self, color )
		gcolor = color
		
		local thecolor = print(color.r, color.g, color.b, color.a)
		
		hook.Add("HUDPaint", "getmodel", function()
		draw.DrawText(color.r.." ".. color.g.. " ".. color.b.. " ".. color.a, "TargetID", ScrW() / 2, ScrH() / 2, Color(255,0,0), TEXT_ALIGN_CENTER)
		end)
		
	end
end

menu()
+rep to my nigga D3MOL1T10N
draw(.)Roundedbox mpgh thinks this is link
Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?