Answered How to add Raygun without FREEZING ?!

zOlymP

Well-Known Member
Messages
55
Reaction score
28
Points
228
I need help to add the Raygun Code or some other modded gun codes without freezing can anyone help me please ?
OS7nXeh.gif







example :

initRaygunM2()
{
if(self.isRaygunM2 == 0)
{
self initGiveWeap("beretta93r_mp+reflex", "", 38, 0);
self thread doRaygunM2();
self iPrintln("^1Ray Gun Mark II ^5ON");
self thread optionCalledMesage("Wow!! ^1Ray Gun Mk. 2?!", 1, "^7Upgraded Weapon ^1LOL", (1, 0.502, 0.251), 8);
self.isRaygunM2 = 1;
}
else
{
self notify("stop_RaygunM2");
self notify("stop_RaygunM2FX");
self takeWeapon("beretta93r_mp+reflex");
self iPrintln("^1Ray Gun Mark II ^4OFF");
self.isRaygunM2 = 0;
}
}

doRaygunM2()
{
self endon("disconnect");
self endon("stop_RaygunM2");

self thread waitRaygunM2Suicide();

for(;
wink.gif

{
self waittill("weapon_fired");
if(self getCurrentWeapon() == "beretta93r_mp+reflex")
{
self thread mainRaygunM2();
}
}
}

mainRaygunM2()
{
raygunM2Explode = loadfx("weapon/bouncing_betty/fx_betty_destroyed");
raygunM2Explode2 = loadfx("weapon/tracer/fx_tracer_flak_single_noExp");
weapOrigin = self getTagOrigin("tag_weapon_right");
target = self traceBullet();

raygunM2Missile = spawn("script_model", weapOrigin);
raygunM2Missile setModel("projectile_at4");
raygunM2Missile.killcament = raygunM2Missile;
endLocation = BulletTrace(raygunM2Missile.origin, target, false, self)["position"];
raygunM2Missile.angles = VectorToAngles(endLocation - raygunM2Missile.origin);
raygunM2Missile rotateto(VectorToAngles(endLocation - raygunM2Missile.origin), 0.001);

raygunM2Missile moveto(endLocation, 0.3);
self thread raygunM2Effect(raygunM2Missile, endLocation);
wait 0.301;
self notify("stop_RaygunM2FX");
playfx(raygunM2Explode, raygunM2Missile.origin);
playfx(raygunM2Explode2, raygunM2Missile.origin);
raygunM2Missile playsound("wpn_flash_grenade_explode");
earthquake(1, 1, raygunM2Missile.origin, 300);
raygunM2Missile RadiusDamage(raygunM2Missile.origin, 270, 270, 270, self);
raygunM2Missile delete();
}

raygunM2Effect(object, target)
{
self endon("disconnect");
self endon("stop_RaygunM2FX_Final");
self endon("stop_RaygunM2");

raygunM2Laser = loadFX("misc/fx_equip_tac_insert_light_red");

for(;
wink.gif

{
raygunM2Red = spawnFx(raygunM2Laser, object.origin, VectorToAngles(target - object.origin));
triggerFx(raygunM2Red);
wait 0.0005;
raygunM2Red delete();
}

for(;
wink.gif

{
self waittill("stop_RaygunM2FX");
raygunM2Red delete();
self notify("stop_RaygunM2FX_Final");
}
}

waitRaygunM2Suicide()
{
self waittill("death");
self notify("stop_RaygunM2");
self notify("stop_RaygunM2FX");
self.isRaygunM2 = 0;
}
 

The Dark Side

Former Staff Member
Messages
1,004
Reaction score
770
Points
993
1. Put the code in php tag or just a normal code tag, to avoid a messy post.

2. Its probably because you're missing functions that go with it. (I.E Optioncalledmessage, Tracebullet) If you still freeze afterwards, you're still missing more. Or you did something else wrong.
 
Top