Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. local function HideThings( name )
  2.     if(name == "CHudHealth") or (name == "CHudBattery") then
  3.      return false
  4.     end
  5.     -- We don't return anything here otherwise it will overwrite all other
  6.     -- HUDShouldDraw hooks.
  7. end
  8. hook.Add( "HUDShouldDraw", "HideThings", HideThings )
  9.  
  10.  
  11. local soundURL = "http://jukebox.ijwtb.net/music/Rogue/Unknown/Adventure%20Time.mp3"
  12. soundChannel   = soundChannel or nil
  13.  
  14. function playMusic( url )
  15.     if( soundChannel ) then
  16.         soundChannel:Stop()
  17.         soundChannel = nil
  18.     end
  19.  
  20.     hook.Add( "PostDrawOpaqueRenderables", "Visualizer", playVisual )
  21.    
  22.     sound.PlayURL( url, "noblock", function(cb , errId, errName)
  23.         soundChannel = cb
  24.     end )
  25. end
  26.  
  27. function playVisual()
  28.     if( not IsValid( soundChannel ) ) then return end
  29.  
  30.     local FFTable   = {}
  31.     local FFTLevels = soundChannel:FFT( FFTable, FFT_256 )
  32.     for key, val in pairs( FFTable ) do
  33.         local height = val * 4000
  34.         local keyOffset = key - 1
  35.         cam.Start3D2D( Vector( -1000, 1000, -11275 ), Angle( 0, 0, 90 ), 1 )
  36.             draw.RoundedBox( 0, 22 * keyOffset, ScrH() - height, 22, height, Color(255,key*5,0,255) )
  37.             draw.RoundedBox( 0, 0, 0, ScrW(), ScrH(), Color(120,120,120,2) )
  38.         cam.End3D2D()
  39.     end
  40. end
  41.  
  42. playMusic( soundURL )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement