Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- hook.Add("EntityTakeDamage", "DamageEffects:EntityTakeDamage", function(entity, weapon, attacker, amount, damageinfo)
- if entity:IsPlayer() then
- local breathing = CreateSound(entity, "player/breathe1.wav")
- entity:ViewPunch(damageinfo:GetDamageForce()/100)
- entity:SetDSP(33)
- breathing:Play()
- breathing:FadeOut(3)
- umsg.Start("DamageEffects:EntityTakeDamage", entity)
- umsg.Short(amount)
- umsg.End()
- end
- end)
- else
- local smoother = 0
- local blackness = 0
- usermessage.Hook("DamageEffects:EntityTakeDamage", function(umr)
- local amount = umr:ReadShort()
- blackness = -2
- timer.Simple(amount/100, function()
- blackness = 0
- end)
- end)
- hook.Add("RenderScreenspaceEffects", "DamageEffects:RenderScreenspaceEffects", function()
- smoother = smoother + ((blackness - smoother) / 100)
- local table = {}
- table[ "$pp_colour_addr" ] = 0
- table[ "$pp_colour_addg" ] = 0
- table[ "$pp_colour_addb" ] = 0
- table[ "$pp_colour_brightness" ] = smoother
- table[ "$pp_colour_contrast" ] = 1
- table[ "$pp_colour_colour" ] = 1
- table[ "$pp_colour_mulr" ] = 0
- table[ "$pp_colour_mulg" ] = 0
- table[ "$pp_colour_mulb" ] = 0
- DrawColorModify(table)
- end)
- end
Add Comment
Please, Sign In to add comment