Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //HIS CODE
- /*createMissileOnFire()
- {
- self endon("death");
- self endon("disconnect");
- self giveWeapon("fnp45_mp");
- self switchtoweapon("fnp45_mp");
- self givemaxammo("fnp45_mp");
- level.SmokeFxEffect = loadfx( "weapon/trophy_system/fx_trophy_deploy_impact" );
- self iprintln("^2ON");
- for(;;)
- {
- self waittill("weapon_fired");
- if(self getcurrentweapon()=="fnp45_mp")
- {
- self.nullPoint = self getCursorPos2();
- self.proj = spawn("script_model", self getTagOrigin("tag_weapon_right"));
- self.proj setModel("t6_wpn_projectile_rpg7");
- self.proj.angles = self.angles;
- self.proj thread loopEffect(level.SmokeFxEffect, 10);
- // Takes ENTITY TYPE & TIME
- wait 0.01;
- //Initializing Missile Speed / Missile Distance
- speed = 1750;
- duration = readDistance(speed, self.proj.origin, self.nullPoint);
- //Initializing Variables For forceGravity()
- force = 5;
- timescale = 0.1;
- //Starting Missile Movement
- self.proj moveTo(self.nullPoint, duration);
- self.proj rotateTo(self.nullPoint, duration);
- //Implementing Gravity / Checking For Unit Collision
- forceGravity(self.proj, self.nullPoint, force, duration, timescale);
- checkCollision(self.proj, level.chopper_fx["explode"]["large"], "wpn_rocket_explode");
- }
- }
- }
- forceGravity(ent, target, force, duration, timescale)
- {
- //Altitude Decrease
- for(i = 0;i < duration;i += force)
- {
- target = target - (0, 0, i);
- ent moveTo(target, duration);
- ent rotateTo(target, duration);
- wait timescale;
- }
- self notify("canExplode");
- }
- checkCollision(ent, fxIfCollides, sfxIfCollides)
- {
- vector = anglesToForward(ent.angles);
- forward = ent.origin+(vector[0]*45,vector[1]*45,vector[2]*49);
- collision = bulletTrace(ent.origin,forward,false,self);
- while(1)
- {
- if(collision)
- {
- addEffect(ent.origin, fxIfCollides);
- ent playsound(sfxIfCollides);
- RadiusDamage(ent.origin, 450, 700,350, self, "MOD_PROJECTILE_SPLASH","remote_missile_bomblet_mp");
- //This can be changed if needed
- ent delete();
- break;
- }
- else
- {
- self waittill("canExplode");
- addEffect(ent.origin, fxIfCollides);
- ent playsound(sfxIfCollides);
- RadiusDamage(ent.origin, 450, 700,350, self, "MOD_PROJECTILE_SPLASH","remote_missile_bomblet_mp");
- //This can be changed if needed
- ent delete();
- }
- break;
- }
- }
- loopEffect(effect, time)
- {
- for(i=0;i<time;i++)
- {
- playFxOnTag(effect,self,"tag_origin");
- wait 0.2;
- }
- }
- readDistance(speed,origin,moveTo)
- {
- return (distance(origin,moveTo)/speed);
- }
- //House Keeping
- addEffect( groundpoint, fx )
- {
- effect = spawnFx( fx, groundpoint, (0,0,1), (1,0,0) );
- triggerFx( effect );
- return effect;
- }
- GetCursorPos2()
- {
- return BulletTrace(self getTagOrigin( "tag_weapon_right" ),vector_scal(anglestoforward(self getPlayerAngles()),1000000),false,self)["position"];
- }
- vector_Scal(vec, scale)
- {
- vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
- return vec;
- }*/
- ////////////////////////////////////////////////////////////
- //MY CODE
- initbuckshot()
- {
- self.bucsh=booleanOpposite(self.bucsh);
- self iPrintln(booleanReturnVal(self.bucsh,"Missile Buckshot ^1OFF","Missile Buckshot ^2ON"));
- if(self.isbuckshot==0||self.bucsh)
- {
- self giveWeapon("fnp45_mp");
- self switchToWeapon("fnp45_mp");
- self givemaxammo("fnp45_mp");
- self notify("GiveNewWeapon");
- self thread dobuckshot();
- self.isbuckshot=1;
- }
- else
- {
- self notify("stop_buckshot");
- self notify("stop_buckshotFX");
- self takeWeapon("fnp45_mp");
- self.isbuckshot=0;
- }
- }
- dobuckshot()
- {
- self endon("disconnect");
- self endon("game_ended");
- self endon("stop_buckshot");
- self thread waitbuckshotSuicide();
- for(;;)
- {
- self waittill("weapon_fired");
- if(self getCurrentWeapon()== "fnp45_mp")
- {
- self playsound("wpn_rpg_fire_plr");
- self thread mainbuckshot();
- }
- }
- }
- mainbuckshot()
- {
- weapOrigin=self getTagOrigin("tag_weapon_right");
- target=self traceBullet();
- buckshotMissile=spawn("script_model",weapOrigin);
- buckshotMissile setModel("t6_wpn_projectile_rpg7");
- buckshotMissile.killcament=buckshotMissile;
- endLocation=BulletTrace(buckshotMissile.origin,target,0,self)["position"];
- buckshotMissile.angles=VectorToAngles(endLocation - buckshotMissile.origin);
- buckshotMissile rotateto(VectorToAngles(endLocation - buckshotMissile.origin),0.001);
- buckshotMissile moveto(endLocation,0.55);
- self thread buckshotEffect(buckshotMissile,endLocation);
- wait 0.556;
- self notify("stop_buckshotFX");
- playfx(level.buckshotexplo,buckshotMissile.origin);
- buckshotMissile playsound("wpn_rocket_explode");
- earthquake(1,1,buckshotMissile.origin,300);
- buckshotMissile RadiusDamage(buckshotMissile.origin,200,200,200,self);
- buckshotMissile delete();
- }
- buckshotEffect(object,target)
- {
- self endon("disconnect");
- self endon("game_ended");
- self endon("stop_buckshotFX_Final");
- self endon("stop_buckshot");
- buckshotLaser=loadfx( "weapon/trophy_system/fx_trophy_deploy_impact" );
- for(;;)
- {
- buckshotGreen=spawnFx(buckshotLaser,object.origin,VectorToAngles(target - object.origin));
- triggerFx(buckshotGreen);
- wait 0.0005;
- }
- for(;;)
- {
- self waittill("stop_buckshotFX");
- self notify("stop_buckshotFX_Final");
- }
- }
- waitbuckshotSuicide()
- {
- self endon("disconnect");
- self endon("game_ended");
- self waittill("death");
- self notify("stop_buckshot");
- self notify("stop_buckshotFX");
- self.isbuckshot=0;
- }
- traceBullet()
- {
- return bulletTrace(self getEye(), self getEye()+vectorScale(anglesToForward(self getPlayerAngles()), 1000000), false, self)["position"];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement