Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. hook.Add( "KeyPress", "keypress_use_hi", function( ply, key )
  2. if ( key == IN_USE ) then
  3. local function CheckBadEnt(ent)
  4. if not IsValid(ent) then return end
  5.  
  6. local name = ent:GetClass()
  7. if ( name == "ambient_generic" or name == "env_soundscape" or name == "env_soundscape_triggerable" ) then
  8. timer.Simple(0, function() ent:Remove() end)
  9. end
  10. return
  11. end
  12. end
  13. end )
  14.  
  15. hook.Add( "InitPostEntity", "RemoveSounds", function()
  16. for _, ent in ipairs( ents.GetAll() ) do
  17. CheckBadEnt(ent)
  18. end
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement