• [E2 Release] Plasma/energy launcher
    1 replies, posted
(Code is absolute shit and disorganized, but i dont care) how to use: -make sure RPG is equipped -make sure you have TF2 installed and mounted -make sure server has propcore and E2 -to fire, either hold the right click or just click -the longer you hold down the fire, the more powerful the shot will be -Extract the folders for the audio files in your sounds/weapons folder Video: [video=youtube;dY6vlX36UqA]http://www.youtube.com/watch?v=dY6vlX36UqA&feature=youtu.be[/video] Audio Files (serisism.tk) [url]http://www.serisism.tk/download/misc/titan_sniper.rar[/url] (be patient, the file is large) Audio Files (dropbox) [url]https://www.dropbox.com/s/o97ufpivvuxssp0/titan_sniper.rar[/url] file download: [url]http://www.serisism.tk/download/garrysmod/e2/energy_launcher.txt[/url] [CODE]@name Energy Launcher @inputs @outputs Missile:entity Refire Reload For Fuel Speed Apply O:entity Fire Miss:array @persist Charging Charge R ChargeRot Rot Cool OverCharge @trigger runOnTick(1) runOnLast(1) rangerPersist(1) entity():propNotSolid(0) O=owner() if (first()|dupefinished()) { holoCreate(4) holoCreate(50) holoCreate(51) holoCreate(52) holoCreate(53) holoCreate(54) holoModel(4,"models/weapons/c_models/c_drg_cowmangler/c_drg_cowmangler.mdl") holoPos(4,O:attachmentPos("anim_attachment_RH")+vec(0,0,2.8)) holoAng(4,O:attachmentAng("anim_attachment_RH")+ang(-17,0,0)) holoParentAttachment(4,O,"anim_attachment_RH") #rotator thing holoModel(51,"models/Items/combine_rifle_ammo01.mdl") holoModel(52,"models/Items/combine_rifle_ammo01.mdl") holoModel(53,"models/Items/combine_rifle_ammo01.mdl") holoModel(54,"models/Items/combine_rifle_ammo01.mdl") holoPos(50,holoEntity(4):toWorld(vec(21,0,5))) holoAng(50,holoEntity(4):angles()) holoPos(51,holoEntity(4):toWorld(vec(18,-5,5))) holoPos(52,holoEntity(4):toWorld(vec(18,5,5))) holoPos(53,holoEntity(4):toWorld(vec(18,0,0))) holoPos(54,holoEntity(4):toWorld(vec(18,0,10))) holoAng(51,holoEntity(4):toWorld(ang(90,0,0))) holoAng(52,holoEntity(4):toWorld(ang(90,0,0))) holoAng(53,holoEntity(4):toWorld(ang(90,0,0))) holoAng(54,holoEntity(4):toWorld(ang(90,0,0))) holoParent(50,4) holoParent(51,50) holoParent(52,50) holoParent(53,50) holoParent(54,50) holoScale(50,vec(0.7,0.7,0.7)) holoScale(51,vec(1.3,0.7,1.3)) holoScale(52,vec(1.3,0.7,1.3)) holoScale(53,vec(1.3,0.7,1.3)) holoScale(54,vec(1.3,0.7,1.3)) entity():setAlpha(255) Refire=1 Reload=1 function entity:turnTo(Tarang:angle){ V = This:toLocal(rotationVector(quat(Tarang)/quat(This))+This:pos()) This:applyTorque((125*V - 15*This:angVelVector())*This:inertia()/6) } } if (changed(Refire)&Refire==0){R=int(random(1,4)) if(Charge==1){ChargeRot=11.8 if(R==1){owner():soundPlay(3,1.5,"weapons/titan_sniper/wpn_titansniper_3p_wpnfire_low_energy_2ch_v1_01.wa v")} if(R==2){owner():soundPlay(3,1.5,"weapons/titan_sniper/wpn_titansniper_3p_wpnfire_low_energy_2ch_v1_02.wa v")} if(R==3){owner():soundPlay(3,1.5,"weapons/titan_sniper/wpn_titansniper_3p_wpnfire_low_energy_2ch_v1_03.wa v")} } if(Charge==2){ if(R==1){owner():soundPlay(3,2,"weapons/titan_sniper/stereo/wpn_titansniper_1p_wpnfire_level3_reduced_6ch_01.w av") owner():soundPlay(5,3,"weapons/titan_sniper/wpn_titansniper_3p_wpnfire_med_ballistic_2ch_v1_01 .wav")} if(R==2){owner():soundPlay(3,2,"weapons/titan_sniper/stereo/wpn_titansniper_1p_wpnfire_level3_reduced_6ch_02.w av") owner():soundPlay(5,3,"weapons/titan_sniper/wpn_titansniper_3p_wpnfire_med_ballistic_2ch_v1_01 .wav")} if(R==3){owner():soundPlay(3,2,"weapons/titan_sniper/stereo/wpn_titansniper_1p_wpnfire_level3_reduced_6ch_04.w av") owner():soundPlay(5,3,"weapons/titan_sniper/wpn_titansniper_3p_wpnfire_med_ballistic_2ch_v1_01 .wav")} } if(Charge==3){ if(R==1){owner():soundPlay(3,3,"weapons/titan_sniper/stereo/wpn_titansniper_1p_wpnfire_level4_reduced_6ch_01.w av")} if(R==2){owner():soundPlay(3,3,"weapons/titan_sniper/stereo/wpn_titansniper_1p_wpnfire_level4_reduced_6ch_03.w av")} if(R==3){owner():soundPlay(3,3,"weapons/titan_sniper/stereo/wpn_titansniper_1p_wpnfire_level4_reduced_6ch_04.w av")} } soundPitch(3,100)} if (Fire==1&Refire==1){Refire=0 Charging=0 Fire=0 if(Charge==1){Missile=propSpawn("models/props_phx/ww2bomb.mdl",holoEntity(4):pos(),0)} if(Charge==2){Missile=propSpawn("models/props_phx/amraam.mdl",holoEntity(4):pos(),0)} if(Charge==3){Missile=propSpawn("models/props_phx/mk-82.mdl",holoEntity(4):pos(),0)} Missile:setAng(owner():eyeAngles()) Missile:setAlpha(0) Missile:propGravity(0) Missile:propNotSolid(1) Missile:setTrails(50,0,1,"trails/physbeam",vec(255,255,255),200) holoCreate(3) holoModel(3,"hq_sphere") holoMaterial(3,"models/alyx/emptool_glow") holoScale(3,vec(1,1,1)) holoAlpha(3,0) holoColor(3,vec(200,200,255)) holoPos(3,Missile:pos()) holoAng(3,Missile:angles()) holoParent(3,Missile) rangerFilter(Missile) rangerFilter(owner()) holoAlpha(2,0) Missile:setAng(owner():eyeAngles()) Miss:pushEntity(Missile) Missile:propNotSolid(1) #particle("striderbuster_attached_pulse_solid",Missile) #particle("finish",Missile) #particle("striderbuster_trail",Missile) timer("un",400) timer("poof",50) timer("Fuel",150) if(Charge==1){timer("reload",1000)} if(Charge==2){timer("reload",2000)} if(Charge==3){timer("reload",3000)} timer("1000",1000) holoAlpha(2,0) if(OverCharge==1){ Missile:setTrails(150,0,1,"trails/physbeam",vec(255,255,255),200) timer("OT",50) } } #overcharge if(clk("OT")){ Missile:setPos(owner():aimPos()) timer("OE",100) } if(clk("OE")){ Missile:propBreak() } if(clk("1000")){Missile:propNotSolid(0)} if (clk("un")){Missile:propNotSolid(0) Apply=1} if (clk("poof")){ Missile:applyForce((Missile:forward())*50000) Missile:applyForce((Missile:up())*0) } if (clk("Fuel")){For=1 #Missile:soundPlay(2,0,"/weapons/acf_gun/missilefire.wav") holoCreate(1) holoModel(1,"models/buildables/sapper_dispenser.mdl") holoScale(1,vec(0.3,0.42,0.42)) holoAlpha(1,0) holoCreate(10) holoModel(10,"models/buildables/sapper_dispenser.mdl") holoScale(10,vec(0.3,0.42,0.42)) holoAlpha(10,0) holoCreate(11) holoModel(11,"models/buildables/sapper_dispenser.mdl") holoScale(11,vec(0.3,0.42,0.42)) holoAlpha(11,0) holoPos(1,Missile:toWorld(vec(-75,5,0))) holoParent(1,Missile) Speed=18000000} if (For==1){ Missile:applyForce((Missile:forward())*40000) Missile:applyAngForce((ang(2,0,0))*100) #Missile:turnTo((owner():aimPos() - Missile:pos()):toAngle()) } if (clk("reload")){Refire=1 owner():soundPlay(5,1,"PS2/recharge.wav") For=0 Missile:propBreak() holoAlpha(2,255) Apply=0 } if (For==1){Ranger = rangerOffset(200, Missile:pos(),Missile:vel():normalized())} if (Ranger:hit()){ holoCreate(10) holoPos(10,Missile:pos()) holoAlpha(10,0) #particle("finish",holoEntity(10)) #particle("portal_rift_flash_01",holoEntity(10)) soundPitch(10,200) soundPitch(11,200) Missile:propBreak() } if (owner():weapon():type()=="weapon_rpg"&Refire==1){holoAlpha(2,255) owner():weapon():setAlpha(0) holoAlpha(4,255) holoAlpha(50,0) holoAlpha(51,255) holoAlpha(52,255) holoAlpha(53,255) holoAlpha(54,255) #particle("finish",holoEntity(1)) holoDelete(1) holoDelete(10) holoDelete(11) } if (owner():weapon():type()!="weapon_rpg"){holoAlpha(2,0) holoAlpha(4,0) holoAlpha(50,0) holoAlpha(51,0) holoAlpha(52,0) holoAlpha(53,0) holoAlpha(54,0) } if (owner():weapon():type()=="weapon_rpg"&own
That's pretty sexy. Someone should make a swep based off of it.
Sorry, you need to Log In to post a reply to this thread.