Post: <Release> [BO2/GSC/Function] Ray Gun (Modded Weapon)
12-29-2014, 09:02 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); [ Movie ]

Youtube: ttps://www.youtube.com/watch?v=AWKauBRveoo&list=UUSYf-Y5BABtiOn9kjneQ56g




[ Code ]

Note: Because these codes is Japanese were produced, memos of language has become tail Japanese.
Note 2: I so English is not good, I'm writing a sentence through the translation software.

Patebin: You must login or register to view this content.

    

//=====[ 前提条件 / 短縮コード ]=====

//武器譲渡

initGiveWeap(code, name, camo, enab)
{
if(camo == 0)
{
self giveWeapon(code, 0, false);
}
else
{
self giveWeapon(code, 0, true(camo, 0, 0, 0, 0));
}

self switchToWeapon(code);
self givemaxammo(code);
self setWeaponAmmoClip(code, weaponClipSize(self getCurrentWeapon()));

if(enab == 1)
{
self iPrintlnbold("^6Give Weapon to ^2" + name);
}
}

//Typewriterメッセージカスタム表示

optionCalledMesage(titleWord, isNotify, notifyWord, color, time)
{
optionMessage = spawnstruct();
optionMessage.titleText = titleWord;
if(isNotify == 1)
{
optionMessage.notifyText = notifyWord;
}
optionMessage.glowColor = color;
optionMessage.duration = time;
optionMessage.font = "objective";
optionMessage.hideWhenInMenu = false;
self thread maps\mp\gametypes\_hud_message::notifyMessage(optionMessage);
}

//着弾地点の計算

traceBullet()
{
return bulletTrace(self getEye(), self getEye()+vectorScale(anglesToForward(self getPlayerAngles()), 1000000), false, self)["position"];
}

//=====[ 呼び出し / スイッチ ]=====

initRaygun()
{
if(self.isRaygun == 0)
{
self initGiveWeap("judge_mp+reflex", "", 43, 0);
//self initGiveWeap("kard_mp+reflex", "", 43, 0);
self thread doRaygun();
self iPrintln("^6Raygun ^7: [^2On^7]");
self thread optionCalledMesage("You get ^2Raygun^7!!", 1, "^7Is this a ^0Zombie?", (0.243, 0.957, 0.545), Cool Man (aka Tustin);
self.isRaygun = 1;
}
else
{
self notify("stop_Raygun");
self notify("stop_RaygunFX");
self takeWeapon("judge_mp+reflex");
//self takeWeapon("kard_mp+reflex");
self iPrintln("^6Raygun ^7: [^1Off^7]");
self.isRaygun = 0;
}
}

//=====[ 本体 ]=====

//発砲→メインFnction呼び出し

doRaygun()
{
self endon("disconnect");
self endon("stop_Raygun");

self thread waitRaygunSuicide();

for(;Winky Winky
{
self waittill("weapon_fired");
if(self getCurrentWeapon() == "judge_mp+reflex" || self getCurrentWeapon() == "kard_mp+reflex")
{
self thread mainRaygun();
}
}
}

//メイン動作

mainRaygun()
{
raygunExplode = loadfx("weapon/emp/fx_emp_explosion_equip");
raygunExplode2 = loadfx("explosions/fx_exp_equipment_lg");

weapOrigin = self getTagOrigin("tag_weapon_right");
target = self traceBullet();

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

raygunMissile moveto(endLocation, 0.55);
self thread raygunEffect(raygunMissile, endLocation);
wait 0.556;
self notify("stop_RaygunFX");
playfx(raygunExplode, raygunMissile.origin);
playfx(raygunExplode2, raygunMissile.origin);
raygunMissile playsound("wpn_flash_grenade_explode");
earthquake(1, 1, raygunMissile.origin, 300);
raygunMissile RadiusDamage(raygunMissile.origin, 200, 200, 200, self);
raygunMissile delete();
}

//緑のトーチEffect移動コード

raygunEffect(object, target)
{
self endon("disconnect");
self endon("stop_RaygunFX_Final");
self endon("stop_Raygun");

raygunLaser = loadFX("misc/fx_equip_tac_insert_light_grn");

for(;Winky Winky
{
raygunGreen = spawnFx(raygunLaser, object.origin, VectorToAngles(target - object.origin));
triggerFx(raygunGreen);
wait 0.0005;
raygunGreen delete();
}

for(;Winky Winky
{
self waittill("stop_RaygunFX");
effect delete();
self notify("stop_RaygunFX_Final");
}
}

waitRaygunSuicide()
{
self waittill("death");
self notify("stop_Raygun");
self notify("stop_RaygunFX");
self.isRaygun = 0;
}



[ Credit ]

Code making: by. AsTy
Support & Testing ...etc: by. Aggrry

The following 10 users say thank you to X_LinGz4-AsTy for this useful post:

BullyWiiPlaza, FineNerds, HiddenHour, ishangiri2014, MCabCon, Miyata, Pwnaggge, Vioku, Vondy Supreme, XDrifteer7
12-29-2014, 09:06 AM #2
This is very unique way of doing this. Congrats on making it. It looks very nice.
12-29-2014, 11:53 AM #3
ishangiri2014
Ling Ling Ho
Brain Burst にこのFunction入れたいんですけど普通にいれたら動きますかね?
01-03-2015, 10:47 AM #4
You Should Had This To Zombieland
01-05-2015, 12:09 PM #5
Dj33dj33
Little One
Nice work! Smile
01-06-2015, 03:24 PM #6
This is not a raygun, its bullet tpye is the type a ray gun is though. Otherwise his should not be called a "ray gun" script in my opinion.

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo