Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- local ply = LocalPlayer()
- local snd = CreateSound(ply, "ambient/water/underwater.wav")
- hook.Add("PreDrawHUD",1,function()--error()
- if ply:IsUnderWater() then
- snd:PlayEx(100, 50)
- ply:SetDSP(14)
- surface.SetDrawColor(COLOR.r*0.3, COLOR.g*0.3, COLOR.b*0.3, COLOR.a*1.3)
- surface.DrawRect(-2,-2, 4,4)
- ply.water_dsp_reset = false
- elseif not ply.water_dsp_reset then
- snd:Stop()
- ply:SetDSP(0)
- ply.water_dsp_reset = true
- end
- end)
- end
- HmmWaterLevel = HmmWaterLevel or _R.Entity.WaterLevel
- function _R.Entity:WaterLevel(...)
- if self:IsUnderWater() then
- return 3
- end
- return HmmWaterLevel(self, ...)
- end
Advertisement
Add Comment
Please, Sign In to add comment