-- oink.industries
-- lua source: lua/autorun/client/m1dy_rave_two.lua
--M1DY >   COLD PIZZA - (ORIGINAL MIX)

--canspider's apeshit visuals

--couple things taken from rave.lua also known as mlg

concommand.Add("goapeshit",function()



local url = "https://lol.tf/CripXwU.mp3"

local value = 1

local time = 0

local bool = false

local bool2 = true

local bool3 = false

local model = "models/Humans/Group01/Male_Cheaple.mdl"

local fuckingshitmat = "effects/jarate_overlay"

local gofuckyourselfmat = "effects/tp_eyefx/tpeye"











RunConsoleCommand("stopsound")

RunConsoleCommand("pp_texturize", "")

RunConsoleCommand("pp_mat_overlay", "")



DrawSobel( 100 )

timer.Remove("quake")

timer.Remove("flashnorm")



hook.Remove("HUDPaint", "dance")

hook.Remove("HUDPaint", "coldpizza")

hook.Remove("HUDPaint", "coldpizza2")

hook.Remove("HUDPaint", "coldpizza3")

hook.Remove("HUDPaint", "coldpizza4")

hook.Remove("HUDPaint", "dance")





local function dancurz()





local mdl = ClientsideModel( model, RENDERGROUP_BOTH )

			mdl:SetNoDraw( true )

			local posCache, time = {}, 0



			hook.Add( "HUDPaint", "dance", function()

				if not mdl.SeqStart or CurTime() > (mdl.SeqStart +mdl.SeqDuration) then

					local idx = mdl:LookupSequence("taunt_dance")

					mdl.SeqDuration = mdl:SequenceDuration( idx )

					mdl.SeqStart = CurTime()

					mdl:ResetSequence( idx )

				end



				mdl:SetCycle( (CurTime() -mdl.SeqStart) /mdl.SeqDuration )





				local w, h = 300, 300

				local ang = Angle( 0, 0, 0 )



				for i = 1, 32 do

					if CurTime() > time then

						posCache[i] = { math.random( 0, ScrW() -w ), math.random( 0, ScrH() -h ) }

					end

					local x, y = posCache[i][1], posCache[i][2]



					cam.Start3D( (ang:Forward() *64) +(ang:Up() *32), (ang:Forward()*-1):Angle(), 90, x, y, w, h )

						cam.IgnoreZ( true )

						render.SuppressEngineLighting( true )



						render.SetLightingOrigin( mdl:GetPos() )

						render.ResetModelLighting( 1, 1, 1 )

						render.SetColorModulation( 0, 0, 1 )



						mdl:DrawModel()



						render.SuppressEngineLighting( false )

						cam.IgnoreZ( false )

					cam.End3D()

				end



				if CurTime() > time then

					time = CurTime() +0.05

				end

			end )



			timer.Create("quake", 0.1, 0, function() LocalPlayer():SetEyeAngles( Angle( LocalPlayer():EyeAngles().p - math.Rand( -20, 20 ) , LocalPlayer():EyeAngles().y - math.Rand( -20, 20 ) , LocalPlayer():EyeAngles().r ) ) util.ScreenShake( Vector(0, 0, 0), 50, 50, 0.42, 00 ) end)

end









local function flasher()

timer.Create("flashnorm", 0, 0, function() 



    if bool2 == true then 

        RunConsoleCommand("pp_mat_overlay", "effects/distortion_normal001")

        bool2=false

    elseif bool2 == false then

        RunConsoleCommand("pp_mat_overlay", "effects/tp_eyefx/tpeye")

        bool2=true

    end



end) 

end



local function fuckingshitstart()

	hook.Add( "HUDPaint", "coldpizza5", function()	draw.SimpleText( "FUCKING SHIT", "ScoreboardDefaultTitle", ScrW() /2 , ScrH() /2 , Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

    timer.Remove("flashnorm")

    RunConsoleCommand("pp_mat_overlay", "effects/jarate_overlay")



    timer.Simple(1, function() hook.Remove("HUDPaint", "coldpizza5") 

	RunConsoleCommand("pp_mat_overlay", "")



    end)

end





local function fuckingshit()

	hook.Add( "HUDPaint", "coldpizza5", function()	draw.SimpleText( "FUCKING SHIT", "ScoreboardDefaultTitle", ScrW() /2 , ScrH() /2 , Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

    timer.Remove("flashnorm")

    

    RunConsoleCommand("pp_mat_overlay", fuckingshitmat)



    timer.Simple(1, function() hook.Remove("HUDPaint", "coldpizza5") 

	if bool3 == false then

        RunConsoleCommand("pp_mat_overlay", "effects/tp_eyefx/tpeye")

    else

    flasher()

    end

    end)

end

local function gfys()

	hook.Add( "HUDPaint", "coldpizza6", function()	draw.SimpleText( "GO FUCK YOURSELF", "ScoreboardDefaultTitle", ScrW() /2 , ScrH() /2 , Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

    timer.Remove("flashnorm")

    RunConsoleCommand("pp_mat_overlay", "models/props_combine/tprings_globe")



    timer.Simple(1.5, function() hook.Remove("HUDPaint", "coldpizza6") 

	if bool3 == false then

        RunConsoleCommand("pp_mat_overlay", gofuckyourselfmat)

    else

    flasher()

    end

    end)

end

local function lady()

	hook.Add( "HUDPaint", "coldpizza7", function()	draw.SimpleText( "FUCKING SHIT LADY DO I SOUND LIKE IM ORDING A PIZZA?", "ScoreboardDefaultTitle", ScrW() /2 , ScrH() /2 +64, Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

    

    timer.Simple(2.5, function() hook.Remove("HUDPaint", "coldpizza7") 

    

    end)

end







timer.Create("lol", 0.02, 0, function()

    if bool == false then

        RunConsoleCommand("pp_texturize", "pp/texturize/lines.png")

        bool = true

    elseif bool == true then

        RunConsoleCommand("pp_texturize", "pp/texturize/plain.png")

        bool = false

    end

end)

sound.PlayURL( url, "3d", function( station )

	if ( IsValid( station ) ) then

        timer.Create("h",0,0,function()

		station:SetPos( LocalPlayer():GetPos() )

        end)

        station:Play()

        station:Play()

        station:Play()

        station:Play()

        station:Play()

        station:Play()

        station:Play()

        station:Play()

        g_station = station

	else

		LocalPlayer():ChatPrint( "FAILED" )

	end

end )





timer.Simple(4, function() LocalPlayer():ChatPrint( "CANSPIDER: YOU'RE IN BIG TROUBLE" ) 

    LocalPlayer():ConCommand( "say IM IN BIG TROUBLE" ) 

	hook.Add( "HUDPaint", "coldpizza", function()	draw.SimpleText( "MY NAME JEFF AN I LIKE PIZZA", "ScoreboardDefaultTitle", ScrW() /2 +math.random(-300,300), ScrH() /2 +math.random(-300,300) +64, Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

	hook.Add( "HUDPaint", "coldpizza2", function()	draw.SimpleText( "MY NAME JEFF AN I LIKE PIZZA", "ScoreboardDefaultTitle", ScrW() /2 +math.random(-300,300), ScrH() /2 +math.random(-300,300) +64, Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

	hook.Add( "HUDPaint", "coldpizza3", function()	draw.SimpleText( "MY NAME JEFF AN I LIKE PIZZA", "ScoreboardDefaultTitle", ScrW() /2 +math.random(-300,300), ScrH() /2 +math.random(-300,300) +64, Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )

    hook.Add( "RenderScreenspaceEffects", "SobelShader", function()

        value = value-0.0015

	    if value < 0.01 then

            DrawSobel( 0.01 )

        else

            DrawSobel( value )

        end

    end )









end)

timer.Simple(12, function() 

	timer.Create("quake", 0.1, 0, function() util.ScreenShake( Vector(0, 0, 0), 50, 50, 0.42, 00 ) end)

	fuckingshitstart()







timer.Remove("lol") RunConsoleCommand("pp_texturize", "pp/texturize/rainbow.png") hook.Remove("HUDPaint", "coldpizza") hook.Remove("HUDPaint", "coldpizza2") hook.Remove("HUDPaint", "coldpizza3")  end)



timer.Simple(23,function() 

    timer.Remove("quake")

	hook.Add( "HUDPaint", "coldpizza4", function()	draw.SimpleText( "FUCKING SHIT LADY DO I SOUND LIKE IM ORDING A PIZZA?", "ScoreboardDefaultTitle", ScrW() /2 , ScrH() /2 +64, Color(math.random(0,255), math.random(0,255), math.random(0,255)), TEXT_ALIGN_CENTER) end )





end)



timer.Simple(15, function() fuckingshitstart() end)

timer.Simple(17.5, function() fuckingshitstart() end)

timer.Simple(20.5, function() fuckingshitstart() end)











timer.Simple(25.5,function() 

	timer.Create("quake", 0.1, 0, function() 

    LocalPlayer():SetEyeAngles( Angle( LocalPlayer():EyeAngles().p - math.Rand( -20, 20 ) , LocalPlayer():EyeAngles().y - math.Rand( -20, 20 ) , LocalPlayer():EyeAngles().r ) )

    util.ScreenShake( Vector(0, 0, 0), 50, 50, 0.42, 00 ) end)

hook.Remove("HUDPaint", "coldpizza4")

	RunConsoleCommand("pp_mat_overlay", "effects/tp_eyefx/tpeye")

      

end)

timer.Simple(35,function() gfys() end)



timer.Simple(44,function() lady() end)

timer.Simple(68,function() fuckingshit() end)



timer.Simple(116, function() fuckingshit() end)

timer.Simple(119, function() fuckingshit() end)

timer.Simple(121.5, function() fuckingshit() end)

timer.Simple(124.5, function() lady() end)

timer.Simple(136.5, function() gfys() end)

timer.Simple(145.5, function() lady() end)



timer.Simple(169.5, function() fuckingshit() end)

timer.Simple(170, function() hook.Remove("HUDPaint", "dance") timer.Remove("quake") model = "models/vortigaunt.mdl" 



hook.Add( "PostDrawTranslucentRenderables", "intodafutur", function()

	render.SetMaterial( Material("cable/blue_elec") )

	for i = 1, 32 do

		render.DrawBeam( LocalPlayer():GetPos() +Vector(0, 0, 128) +(EyeAngles():Forward() *256), EyePos() +(VectorRand() *256), 4, 0, 12.5, Color(255, 255, 255, 255) )

	end

end )





end)

timer.Simple(176, function() dancurz() end)

timer.Simple(213.5, function() fuckingshit() end)

timer.Simple(216.5, function() fuckingshit() end)

timer.Simple(219, function() fuckingshit() end)

timer.Simple(222, function() fuckingshit() end)

timer.Simple(224.5, function() lady() end)



timer.Simple(69.5,function() 

timer.Remove("quake")

end)

timer.Simple(73.5,function() 

    bool3 = true

    flasher()

    dancurz()



	

end)













timer.Simple(228, function()



bool3=false



RunConsoleCommand("stopsound")

RunConsoleCommand("pp_texturize", "")

RunConsoleCommand("pp_mat_overlay", "")

hook.Remove("RenderScreenspaceEffects", "SobelShader")

timer.Remove("quake")

timer.Remove("clock")

timer.Remove("flashnorm")

hook.Remove("PostDrawTranslucentRenderables", "intodafutur")

hook.Remove("HUDPaint", "coldpizza")

hook.Remove("HUDPaint", "coldpizza2")

hook.Remove("HUDPaint", "coldpizza3")

hook.Remove("HUDPaint", "coldpizza4")

hook.Remove("HUDPaint", "coldpizza5")

hook.Remove("HUDPaint", "coldpizza6")

hook.Remove("HUDPaint", "dance")



end)

end)
