CapsAdmin

Untitled

Nov 12th, 2011
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. if CLIENT then
  2.  
  3.     local ply = LocalPlayer()
  4.     local snd = CreateSound(ply, "ambient/water/underwater.wav")
  5.  
  6.     hook.Add("PreDrawHUD",1,function()--error()
  7.         if ply:IsUnderWater() then
  8.             snd:PlayEx(100, 50)
  9.             ply:SetDSP(14)
  10.                            
  11.             surface.SetDrawColor(COLOR.r*0.3, COLOR.g*0.3, COLOR.b*0.3, COLOR.a*1.3)
  12.             surface.DrawRect(-2,-2, 4,4)
  13.  
  14.             ply.water_dsp_reset = false
  15.         elseif not ply.water_dsp_reset then
  16.             snd:Stop()
  17.             ply:SetDSP(0)
  18.            
  19.             ply.water_dsp_reset = true
  20.         end
  21.     end)
  22.  
  23. end
  24.  
  25. HmmWaterLevel = HmmWaterLevel or _R.Entity.WaterLevel
  26.  
  27. function _R.Entity:WaterLevel(...)
  28.     if self:IsUnderWater() then
  29.         return 3
  30.     end
  31.     return HmmWaterLevel(self, ...)
  32. end
  33.  
Advertisement
Add Comment
Please, Sign In to add comment