Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local ChosenColor = Color(255, 255, 255, 255)
- --local ChosenColor2 = Color(255, 255, 255, 255)
- gap = 0
- width = 1
- size = 10
- hook.Remove("HUDPaint", "Crosshair")
- local CrosshairChanger = vgui.Create( "DFrame" )
- CrosshairChanger:SetTitle( "Crosshair Customizer" )
- CrosshairChanger:SetSize( 300, 300 )
- CrosshairChanger:Center()
- CrosshairChanger:MakePopup()
- CrosshairChanger:ShowCloseButton(false)
- CrosshairChanger:SetVisible(false)
- CrosshairChanger.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 40, 40, 40, 255 ) )
- end
- local closeButton = vgui.Create( "DButton", CrosshairChanger )
- closeButton:SetText( "X" )
- closeButton:SetTextColor( Color( 255, 0, 0 ) )
- closeButton:SetPos( CrosshairChanger:GetWide() - 20, 0 )
- closeButton:SetSize( 20, 20 )
- closeButton.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 50, 50, 50, 255 ) )
- end
- closeButton.DoClick = function()
- CrosshairChanger:SetVisible(false)
- end
- local SizeSlider = vgui.Create( "DNumSlider", CrosshairChanger )
- SizeSlider:SetPos( 10, 150 ) // Set the position
- SizeSlider:SetSize( 200, 15 ) // Set the size
- SizeSlider:SetText( "Size" ) // Set the text above the slider
- SizeSlider:SetMin( 1 ) // Set the minimum number you can slide to
- SizeSlider:SetMax( 100 ) // Set the maximum number you can slide to
- SizeSlider:SetValue( size )
- SizeSlider:SetDecimals( 0 ) // Decimal places - zero for whole number
- SizeSlider.OnValueChanged = function( panel, value )
- size = math.Round(value)
- end
- local GapSizeSlider = vgui.Create( "DNumSlider", CrosshairChanger )
- GapSizeSlider:SetPos( 10, 165 ) // Set the position
- GapSizeSlider:SetSize( 200, 15 ) // Set the size
- GapSizeSlider:SetText( "Gap Size" ) // Set the text above the slider
- GapSizeSlider:SetMin( 0 ) // Set the minimum number you can slide to
- GapSizeSlider:SetMax( 100 ) // Set the maximum number you can slide to
- GapSizeSlider:SetValue( gap )
- GapSizeSlider:SetDecimals( 0 ) // Decimal places - zero for whole number
- GapSizeSlider.OnValueChanged = function( panel, value )
- gap = math.Round(value)
- end
- local WidthSlider = vgui.Create( "DNumSlider", CrosshairChanger )
- WidthSlider:SetPos( 10, 180 ) // Set the position
- WidthSlider:SetSize( 200, 15 ) // Set the size
- WidthSlider:SetText( "Width" ) // Set the text above the slider
- WidthSlider:SetMin( 1 ) // Set the minimum number you can slide to
- WidthSlider:SetMax( 200 ) // Set the maximum number you can slide to
- WidthSlider:SetValue( width )
- WidthSlider:SetDecimals( 0 ) // Decimal places - zero for whole number
- WidthSlider.OnValueChanged = function( panel, value )
- width = math.Round(value)
- end
- local DermaCheckboxone = vgui.Create( "DCheckBoxLabel" , CrosshairChanger )// Create the checkbox
- DermaCheckboxone:SetPos( 5, 50 )// Set the position
- DermaCheckboxone:SetValue(false)
- DermaCheckboxone:SetText("Enable Crosshair")
- /*
- local Text = vgui.Create( "DLabel", CrosshairChanger )
- Text:SetPos( 25, 50 )
- Text:SetSize( 100, 15)
- Text:SetText( "Enable Crosshair" )
- */
- /*
- if DermaCheckboxone:GetChecked() == false then
- print("Not checked")
- end
- */
- local DermaCheckboxtwo = vgui.Create( "DCheckBoxLabel" , CrosshairChanger )// Create the checkbox
- DermaCheckboxtwo:SetPos( 5, 70 )// Set the position
- DermaCheckboxtwo:SetValue(false)
- DermaCheckboxtwo:SetText("Rainbow Crosshair")
- /*
- local Text = vgui.Create( "DLabel", CrosshairChanger )
- Text:SetPos( 25, 70 )
- Text:SetSize( 100, 15)
- Text:SetText( "Rainbow Crosshair" )
- */
- local outline = vgui.Create( "DCheckBoxLabel" , CrosshairChanger )// Create the checkbox
- outline:SetPos( 5, 90 )// Set the position
- outline:SetValue(false)
- outline:SetText("Outline")
- local ChangeColor = vgui.Create( "DButton", CrosshairChanger )
- ChangeColor:SetText( "Change Color" )
- ChangeColor:SetTextColor( Color( 255, 255, 255 ) )
- ChangeColor:SetPos( CrosshairChanger:GetWide() / 2 - 100 / 2, 110 )
- ChangeColor:SetSize( 100, 30 )
- ChangeColor.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 255 ) ) -- Draw a blue button
- end
- ChangeColor.DoClick = function()
- --Start creating color changer menu
- local Memes = vgui.Create( "DFrame" )
- Memes:SetTitle( "Color Changer" )
- Memes:SetSize( 300, 300 )
- Memes:Center()
- Memes:MakePopup()
- Memes:ShowCloseButton(false)
- Memes.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 40, 40, 40, 255 ) )
- end
- local closeButton = vgui.Create( "DButton", Memes )
- closeButton:SetText( "X" )
- closeButton:SetTextColor( Color( 255, 0, 0 ) )
- closeButton:SetPos( CrosshairChanger:GetWide() - 20, 0 )
- closeButton:SetSize( 20, 20 )
- closeButton.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 50, 50, 50, 255 ) )
- end
- closeButton.DoClick = function()
- Memes:SetVisible(false)
- end
- local ColorPicker = vgui.Create( "DColorMixer", Memes )
- ColorPicker:SetSize( 200, 200 )
- ColorPicker:SetPos( 50, 50 )
- ColorPicker:SetPalette( true )
- ColorPicker:SetAlphaBar( false )
- ColorPicker:SetWangs( true )
- ColorPicker:SetColor( Color( 255, 255, 255 ) )
- local ConfirmColor = vgui.Create( "DButton", Memes )
- ConfirmColor:SetText( "Pick Color" )
- ConfirmColor:SetSize( 90, 30 )
- ConfirmColor:SetPos( 100, Memes:GetTall() - 40 )
- ConfirmColor:SetTextColor(Color (255, 255, 255))
- ConfirmColor.Paint = function( self, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 255 ) ) -- Draw a blue button
- ConfirmColor.DoClick = function()
- ChosenColor = ColorPicker:GetColor() -- Grabs the red, green, blue, and alpha values as a Color object
- ChosenColor2 = ColorPicker:GetColor()
- end
- end
- end
- hook.Add( "HUDPaint", "Crosshair", function()
- if DermaCheckboxone:GetChecked() == true then
- if DermaCheckboxtwo:GetChecked() == true then
- ChosenColor = HSVToColor(RealTime()*120%360,1,1)
- else if ChosenColor2 != nil then
- ChosenColor = ChosenColor2
- else
- ChosenColor = Color(255, 255, 255, 255)
- end
- end
- --draw.RoundedBox( 0, ScrW() / 2 - 1, ScrH() / 2, 5, 5, ChosenColor )
- /*
- surface.DrawCircle( ScrW() / 2, ScrH() / 2, size - 1, 0, 0, 0, 255)
- surface.DrawCircle( ScrW() / 2, ScrH() / 2, size + 1, 0, 0, 0, 255)
- surface.DrawCircle( ScrW() / 2, ScrH() / 2, size, ChosenColor)
- */
- surface.SetDrawColor(0, 0, 0, 255)
- if outline:GetChecked() == true then
- width = width + 2
- surface.DrawOutlinedRect( ScrW() / 2 - width / 2, ScrH() / 2 + gap - 1, width, size + 2)
- surface.DrawOutlinedRect( ScrW() / 2 - width / 2, ScrH() / 2 - gap - size, width, size + 2)
- surface.DrawOutlinedRect( ScrW() / 2 + gap - 2, ScrH() / 2 - width / 2 + 1, size + 2, width)
- surface.DrawOutlinedRect( ScrW() / 2 - gap - size - 1, ScrH() / 2 - width / 2 + 1, size + 2, width)
- width = width - 2
- end
- surface.SetDrawColor( ChosenColor )
- surface.DrawRect( ScrW() / 2 - width / 2, ScrH() / 2 + gap, width, size)
- surface.DrawRect( ScrW() / 2 - width / 2, ScrH() / 2 - gap - size + 1, width, size)
- surface.DrawRect( ScrW() / 2 + gap - 1, ScrH() / 2 - width / 2 + 1, size, width)
- surface.DrawRect( ScrW() / 2 - gap - size, ScrH() / 2 - width / 2 + 1, size, width)
- end
- end)
- local function showcrosshairmenu()
- CrosshairChanger:SetVisible(true)
- end
- concommand.Add("crosshairchanger", showcrosshairmenu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement