Release Modded Weapons | Light Saber V2 source

DERUTA

Well-Known Member
Messages
17
Reaction score
24
Points
218
Remake Light Sabers :tongueclosed:

Code:
givetestsaber()
{
    if(self.givetestsaber==false)
    {
        self do_TestSaber();
        self.givetestsaber=true;
        self.givintestsbers=true;
    }
    else
    {
        self.givetestsaber=false;
        self notify("testsabers");
        self.givintestsbers=false;
    }
}

do_TestSaber()
{
    level.waypointRed=loadFX("misc/fx_equip_tac_insert_light_red");
    level.waypointGreen=loadFX("misc/fx_equip_tac_insert_light_grn");
    level.bettydestroyedfx = loadfx( "weapon/bouncing_betty/fx_betty_destroyed" );
    self iPrintlnbold("^6Lightsaber ^1V2 ^3Given");
    self TakeAllWeapons();
    self setclientthirdperson(1);
    self initGiveWeap("knife_mp", "CS Knife", 1);
     playFxOnTag(level.waypointRed, self, "tag_weapon_left");
     playFxOnTag(level.waypointGreen, self, "tag_weapon_right");
     self endon("death");
     self endon("testsabers");
     self endon("disconnect");
     for(;;)
     {
         if(self attackButtonPressed())
         {
             if(self getCurrentWeapon() == "knife_mp")
                self thread main_TestSaber(1);
         }
         wait 0.05;
     }
}

main_TestSaber(DamageType)
{
    WeaponOrigin = self getTagOrigin("tag_weapon_right");
    Target = self TraceBullet2(1000000);

    TestSaber_Missile = spawn("script_model", WeaponOrigin + VectorScale(AnglesToForward(self GetPlayerAngles()), 70));
    TestSaber_Missile setModel("tag_origin");
    TestSaber_Missile.killcament = TestSaber_Missile;
    EndLocation = BulletTrace(TestSaber_Missile.origin, Target, false, self)["position"];
    TestSaber_Missile.angles = VectorToAngles(EndLocation - TestSaber_Missile.origin);
    TestSaber_Missile rotateto(VectorToAngles(EndLocation - TestSaber_Missile.origin), 0.001);

    if(DamageType == 0)
        self thread effect_TestSaber(TestSaber_Missile, 0);
    else
        self thread effect_TestSaber(TestSaber_Missile, 1);
       
    TestSaber_Missile moveto(EndLocation, 0.25);
    wait 0.251;
    self notify("stop_TestSaber_FX");

    PlayFX(level.chopper_fx["explode"]["large"], TestSaber_Missile.origin);
   
    TestSaber_Missile PlaySound("fly_betty_explo");
    Earthquake(1, 1, TestSaber_Missile.origin, 420);
    TestSaber_Missile RadiusDamage(TestSaber_Missile.origin, 320, 320, 320, self);
    TestSaber_Missile delete();
}

effect_TestSaber(object, DamageType)
{
    self endon("disconnect");
    self endon("stop_TestSaber_FX");
    level.grnorb = loadfx("weapon/sensor_grenade/fx_sensor_exp_scan_friendly");
    for(;;)
    {
        PlayFX(level.grnorb, object.origin);
        object PlaySound("mpl_lightning_flyover_boom");
        if(DamageType == 1)
        {
            Earthquake(1, 1, object.origin, 100);
            object RadiusDamage(object.origin, 90, 90, 90, self);
        }
        wait 0.05;
    }
}

TraceBullet2(Range)
{
    return BulletTrace(self GetEye(), self GetEye() + VectorScale(AnglesToForward(self GetPlayerAngles()), Range), false, self)["position"];
}
 
Top