Making the clients screen a differant color

I want to make the screen of the client to go light blue when he left clicks (this is in a swep) how would i do this

draw.RoundedBox(0,0,0,ScrW(),ScrH(),Color(0,0,255,100))

Just change the value of color to what you want. Dunno what light blue would be.

-snip-

I only want the screen blue when the cloak is on though

[lua] if ply:IsCloaked // or use NWBool
then
" color changeing function"
else

                       "Change the color back to normal"
                                                                          end [/lua]

Use a If Then else statement?

i use draw.roundedbox and would i do this in the SWEP:DrawHud() function?
i have no idea how to use network variables

Color(255,255,255,255)

i know how to get color but thanks

Why not use the RenderScreenspaceEffects hook… i believe that’s what it is there for.

wouldnt that mean they can uncheck it so the effect doesnt appear?

[lua]
function OnPaint()
draw.RoundedBox(0,0,0,ScrW(),ScrH(),Color(0,0,85, 100)) --85 light blue
end
hook.Add( “HUDPaint”, “OnPaint”, OnPaint );
[/lua]

this

I need it only when they are cloaked heres the code so far.

Cl_init.lua
[lua]
include (“shared.lua”)

SWEP.PrintName = “Cloak”
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true

function SWEP:DrawHUD( )
if self.Cloak == true
then
draw.RoundedBox( 0, 0, 0, ScrW(), ScrH(), Color(0, 0, 200, 100) )
else
end
end[/lua]

Init.lua

[lua]AddCSLuaFile (“cl_init.lua”);
AddCSLuaFile (“shared.lua”);

include (“shared.lua”);

SWEP.Weight = 5;
SWEP.AutoSwitchTo = false;
SWEP.AutoSwitchFrom = false;

function SWEP:Initialize()
if (CLIENT) then return end
self:SetWeaponHoldType(“normal”)
end [/lua]

Shared.lua

[lua]SWEP.Author = “Atwal”
SWEP.Contact = “Facepunch”
SWEP.Purpose = “Sneaking”
SWEP.Instructions = "Left click to go invisible
Right click to go visible "
SWEP.Category = “Atwal’s SWEPs”

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “none”

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”

SWEP.Sound = Sound (“items/nvg_on.wav”)
SWEP.Sound1 = Sound (“items/nvg_off.wav”)
SWEP.Cloak = false

SWEP.ViewModel = “models/weapons/v_c4.mdl”
SWEP.WorldModel = “models/weapons/w_c4.mdl”

SWEP.Delay = 1

function SWEP:Deploy()
return true
end

function SWEP:Holster( )
self.Owner:SetColor( 255, 255, 255, 255)
return true
end

function SWEP:Think()
end

function SWEP:PrimaryAttack() --when +attack1 happen

self.Cloak = true

self.Weapon:EmitSound ( self.Sound )
self.Owner:SetColor( 0, 0, 0, 15)

self.Weapon:SetNextPrimaryFire( CurTime() + self.Delay )
self.Weapon:SetNextSecondaryFire( CurTime() + self.Delay )

end

function SWEP:SecondaryAttack( )

self.Cloak = false

self.Owner:SetColor( 255, 255, 255, 255)
self.Weapon:EmitSound ( self.Sound1 )


self.Weapon:SetNextPrimaryFire( CurTime() + self.Delay )
self.Weapon:SetNextSecondaryFire( CurTime() + self.Delay )

end
[/lua]

So far they cloak everything works but the hud isnt updating

[lua]include (“shared.lua”)

SWEP.PrintName = “Cloak”
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true

function SWEP:DrawHUD( )
if self.Cloak == true then
draw.RoundedBox( 0, 0, 0, ScrW(), ScrH(), Color(0, 0, 200, 100) )
elseif self.Cloak == false then
draw.RoundedBox( 0, 0, 0, ScrW(), ScrH(), Color(0, 0, 0, 0) )
end
end[/lua]

K ill try it

Well the functions being called for sure but its still not working no errors either :frowning:

Yes, but that’s why the check box is there… so people with lower-end computers can handle the game.

sv_cheats 1
thirdperson

what will thirdperson do?

nothing changed

[editline]10:45PM[/editline]

its drawing a light blue square on the screen can it really matter that much?

use pp mod , not sure the command off by heart

Alright i’ll try
Weapon stopped appearing

[lua] function SWEP:DrawHUD( )

local tab = {}
	tab[ "$pp_colour_addr" ] = 250
	tab[ "$pp_colour_addg" ] = 0
	tab[ "$pp_colour_addb" ] = 0
	tab[ "$pp_colour_brightness" ] = 0
	tab[ "$pp_colour_contrast" ] = 1
	tab[ "$pp_colour_colour" ] = 1
	tab[ "$pp_colour_mulr" ] = 0
	tab[ "$pp_colour_mulg" ] = 1
	tab[ "$pp_colour_mulb" ] = 1  
	
if self.Cloak == true then  
		DrawColorModify( tab )
	elseif self.Cloak == false then  
end  

end
hook.Add( “RenderScreenspaceEffects”, “RenderColorModifyPOO”, SWEP:DrawHUD() )[/lua]

What did i do wrong?

tab[ “$pp_colour_contrast” ] = 1