Code:
@name xThaWolfx HoloRocketLauncher
@persist H1:entity Blast Shoot Dist Boom Mouse2 Hull
@persist Q:vector Bum Nose Flame T Ready Use AutoAim Ee:entity
@persist Idle
@trigger
runOnTick(1)
runOnChat(1)
O=owner()
Mouse2=O:keyAttack2()
Use=O:keyUse()
Said=O:lastSaid():explode(" ")
C1=Said:string(1)
C2=Said:string(2)
if(chatClk(O)){
if(C1=="!idle"){
Idle=1
}
elseif(C1=="!ready"){
Idle=0
}
}
if(first()){
Hull=100
Bum=200
Nose=300
Flame=400
print("Shooting and Reloading with Mouse2.")
print("Lock on Props with Use.")
print("To have the Launcher on your back, type !idle.")
print("To make the Launcher ready for use, type !ready.")
print("Made by xThaWolfx, Do not re-upload to any site.")
Blast=500
Idle=0
holoCreate(1)
holoCreate(2)
holoCreate(3)
holoCreate(4)
holoCreate(5)
holoCreate(6)
holoCreate(7)
holoCreate(8)
holoCreate(9)
holoCreate(10)
holoCreate(Nose)
holoCreate(Hull)
holoCreate(Flame)
H1=holoEntity(1)
holoParent(1, O)
holoModel(1, "hqcylinder2")
holoScale(1, vec(1,1,5))
holoMaterial(1, "models/XQM/CellShadedCamo_diffuse")
holoColor(1, vec(0,125,0))
holoParent(2,H1)
holoModel(2,"hqcylinder2")
holoPos(2, H1:toWorld(vec(10,0,15)))
holoAng(2, H1:angles()+ang(90,0,0))
holoScale(2, vec(0.3,0.3,1))
holoMaterial(2, "models/XQM/CellShadedCamo_diffuse")
holoColor(2, vec(0,125,0))
holoParent(3, H1)
holoPos(3, H1:toWorld(vec(0,0,30)))
holoModel(3, "hqtorus")
holoScale(3, vec(1,1,2))
holoMaterial(3, "models/XQM/CellShadedCamo_diffuse")
holoColor(3, vec(0,125,0))
holoParent(4,H1)
holoModel(4,"hqcylinder2")
holoPos(4, H1:toWorld(vec(0,0,30)))
holoColor(4, vec(0,0,0))
holoScale(4, vec(0.9,0.9,0.1))
holoParent(5,H1)
holoModel(5,"hqicosphere2")
holoPos(5, H1:toWorld(vec(10,0,15)))
holoAng(5, H1:angles()+ang(90,0,0))
holoScale(5, vec(0.4,0.4,0.5))
holoMaterial(5, "models/XQM/2Deg360_diffuse")
holoColor(5, vec(0,125,0))
holoParent(6,H1)
holoModel(6,"dome")
holoPos(6, H1:toWorld(vec(16,0,15)))
holoScale(6,vec(0.3,0.3,0.2))
holoAng(6,H1:toWorld(ang(90,0,0)))
holoMaterial(6, "models/XQM/CellShadedCamo_diffuse")
holoColor(6, vec(0,125,0))
holoParent(7,H1)
holoModel(7,"hqsphere2")
holoPos(7,H1:toWorld(vec(0,6,25)))
holoScale(7,vec(0.2,0.2,0.2))
holoColor(7,vec(0,255,0))
holoParent(8,H1)
holoModel(8,"hqsphere2")
holoPos(8,H1:toWorld(vec(0,6,15)))
holoScale(8,vec(0.2,0.2,0.2))
holoColor(8,vec(255,0,0))
holoParent(9,H1)
holoPos(9, H1:toWorld(vec(0,0,-29.5)))
holoModel(9,"hqtorus")
holoMaterial(9, "models/XQM/CellShadedCamo_diffuse")
holoColor(9, vec(0,125,0))
holoParent(10,H1)
holoPos(10, H1:toWorld(vec(0,0,-29.5)))
holoModel(10, "hqcylinder")
holoScale(10, vec(0.9,0.9,0.1))
holoColor(10, vec(0,0,0))
}
if(first())
{
holoPos(Hull,H1:pos())
holoCreate(0,vec(0,0,0),vec(0.01,0.5,0.5))
holoMaterial(0,"models/roller/rollermine_glow")
holoCreate(1200,vec(0,0,0))
holoAlpha(1200,0)
}
Rd=O:eyeTrace()
T=(T+5)%360
if(Rd:position())
{
holoPos(0,Rd:position()+Rd:hitNormal()*0.2)
holoAng(0,Rd:hitNormal():toAngle())
holoColor(0,hsv2rgb(vec(1,1,1)))
holoShadow(1200,0)
holoShadow(0,0)
}
holoPos(1200,Rd:position()+Rd:hitNormal()*1)
Ang = angnorm((Q - holoEntity(Hull):pos()):toAngle()+ang(90,0,0))
Forward=holoEntity(Hull):up()
if(!Idle){
if($Mouse2 & Mouse2 & O:aimEntity()!=entity() & !O:keyAttack1()){
if(!Shoot){
Shoot=1
holoCreate(Hull)
holoCreate(Flame)
holoCreate(Nose)
holoPos(Hull,H1:toWorld(vec(0,0,5)))
holoEntity(Flame):setTrails(5,0,1,"trails/smoke",vec(255,255,255),255)
holoEntity(Hull):soundPlay(7331,0,"weapons/rpg/rocket1.wav")
H1:soundPlay(7332,1,"weapons/rpg/rocketfire1.wav")
holoColor(7,vec(255,0,0))
}
elseif(Shoot){
holoEntity(Flame):removeTrails()
Shoot=0
holoEntity(1):soundPlay(7332,1,"weapons/rpg/shotdown.wav")
holoEntity(Hull):soundPlay(7331,0,"")
holoColor(7,vec(0,255,0))
}
}
if($Use & Use){
if(!AutoAim){
AutoAim=1
Ee=O:aimEntity()
holoEntity(8):soundPlay(1,0,"buttons/blip1.wav")
}
elseif(AutoAim){
AutoAim=0
holoEntity(8):soundPlay(1,0,"HL1/fvox/beep.wav")
}
}
if(!AutoAim){
Q=O:aimPos()
holoColor(8,vec(255,0,0))
}
if(AutoAim){
holoColor(8,vec(0,255,0))
Q=Ee:massCenter()
}
holoAng(1, angnorm(O:eye():toAngle()+ang(90,0,0)):setRoll(0):setYaw(O:angles():yaw()))
holoPos(1, O:toWorld(vec(10,-15,60-(O:isCrouch()*30))))
if(!Shoot){
holoPos(Hull,H1:pos())
holoAlpha(Hull,0)
holoAlpha(Nose,0)
holoAlpha(Flame,0)}
elseif(Shoot & !Boom){
holoAng(Hull,Ang)
holoPos(Hull,holoEntity(Hull):pos()+Forward*50)
holoAlpha(Hull,255)
holoAlpha(Nose,255)
holoAlpha(Flame,255)
}
####################################################################################
if(Shoot){Dist=holoEntity(Nose):pos():distance(Q)}
elseif(!Shoot){Dist=10000}
if((Shoot & Dist<=100) | (Shoot & !holoEntity(Nose))){
Boom=1
}
elseif(Shoot & Dist>100){
Boom=0
}
holoModel(Hull,"hqcylinder2")
holoScale(Hull,vec(0.5,0.5,2))
holoAng(Hull,Ang)
if($Boom & Boom){
Blast+=1
holoAlpha(Hull,0)
holoAlpha(Nose,0)
holoAlpha(Flame,0)
holoCreate(Bum,holoEntity(Nose):pos())
holoModel(Bum,"hqsphere2")
holoEntity(Bum):soundPlay(7331,1,"ambient/explosions/explode_2.wav")
holoEntity(Bum):soundPlay(7332,0,"")
holoColor(Bum,vec(150,0,0))
holoMaterial(Bum,"models/effects/splode_sheet")
holoEntity(Flame):removeTrails()
holoDelete(Hull)
holoDelete(Nose)
holoDelete(Flame)
holoCreate(Blast,holoEntity(Bum):pos())
holoAng(Blast,O:eyeTrace():hitNormal():toAngle()+ang(90,0,0))
holoModel(Blast,"hqcylinder2")
if(O:aimEntity()){
holoScale(Blast,vec(O:aimEntity():boxSize():x()/12,O:aimEntity():boxSize():x()/12,0.1))
}
else{holoScale(Blast,vec(25,25,0.1))}
holoParent(Blast,Ee)
holoMaterial(Blast,"models/props_debris/concretefloor020a")
}
if(Boom){
T=T*1+0.1
holoScale(Bum,vec(T,T,T))
}
if(T>=60 | !Shoot | !Boom){
T=0
holoDelete(Bum)
}
}
elseif(Idle){
holoPos(1,O:toWorld(vec(-10,0,40-(O:isCrouch()*20))))
holoAng(1,O:toWorld(ang(0,0,45)))
}
holoParent(Nose,holoEntity(Hull))
holoModel(Nose, "dome")
holoScale(Nose, vec(0.5,0.5,0.5))
holoPos(Nose,holoEntity(Hull):toWorld(vec(0,0,12)))
holoColor(Nose,vec(50,50,50))
holoAng(Nose,holoEntity(Hull):angles())
holoColor(Hull,vec(50,50,50))
holoParent(Flame,Hull)
holoColor(Flame,vec(255,0,0))
holoModel(Flame,"dome")
holoPos(Flame,holoEntity(Hull):toWorld(vec(0,0,-12)))
holoScale(Flame,vec(0.5,0.5,2))
holoAng(Flame,holoEntity(Hull):angles()+ang(180,0,0))
if(duped()){selfDestructAll()} Idle:
Bookmarks