Think Hook for check player states

Hi folks, I am creating a system of life as the “Left 4 Dead”
Create the time that if you have little life, color correction happens, but I can not make the player back from this!
For example, if the player has less than 35 of life (always be verified by a hook of “OnTakeDamage”)

if (SERVER) then
local function Damaged(ply, inflictor, attacker, amount, dmginfo)
health_ply = ply:Health()
if health_ply <= 40 and ply:IsPlayer() then
ply:ConCommand(“pp_colormod 1”)
ply:ConCommand(“pp_colormod_brightness -0.25”)
ply:ConCommand(“pp_colormod_addb 12”)
ply:ConCommand(“pp_colormod_addg 8”)
ply:ConCommand(“pp_colormod_addr 5”)
ply:ConCommand(“pp_colormod_contrast 1.5”)
ply:ConCommand(“pp_motionblur 1”)
ply:ConCommand(“pp_motionblur_addalpha 0.2”)
ply:ConCommand(“pp_motionblur_drawalpha 1”)
if ply:IsPlayer() then
ply:ConCommand(“pp_colormod 0”)
ply:ConCommand(“pp_colormod_brightness 0”)
ply:ConCommand(“pp_colormod_addb 0”)
ply:ConCommand(“pp_colormod_addg 0”)
ply:ConCommand(“pp_colormod_addr 0”)
ply:ConCommand(“pp_colormod_contrast 0”)
ply:ConCommand("pp_colormod_color 1 ")
ply:ConCommand(“pp_motionblur 0”)
ply:ConCommand(“pp_motionblur_addalpha 1”)
ply:ConCommand(“pp_motionblur_drawalpha 1”)

hook.Add(“EntityTakeDamage”, “Damaged”, Damaged)

This code is fully working on

But I can not get a function that uses the “think” to see life, because every time I use it, break the “hook” and I can not include the player for nothing

How could i use the “Hook” “Think” to be used by local players?

Of course I say thank you

You should be doing this on the client with RenderScreenspaceEffects.

thanks, is very userfull :smiley:
But i need check the live of the player on any time

Just do that on the client then.

function PostProcess()

if( LocalPlayer():Health() &lt;= 40 ) then

    -- put your color modifiers here
    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 

DrawColorModify( tab )


hook.Add( “RenderScreenspaceEffects”, “ClusterFuck”, PostProcess )

Sorry i’m a moron i ignored to you and it are full working!