Modme Forums

Script once shoot 3 objects it gives eevrone in game a gun

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: W33DKilla
I need someone that is a good scripter to give me a script that will make everyone in the game get a weapon of my choosing after shooting 3 objects around the map :)


ModmeBot:

Reply By: Abnormal202
I made this in a hurry and I haven't tested it yet, so there's a good chance something is wrong with it.

Open up your mapname.GSC and insert:

level thread easter_egg();

in your main function.

Then paste:

function easter_egg() { level.easter_egg_finished = 0; thread one(); thread two(); thread three(); thread easter_egg_ending(); } function one() { trig_1 = GetEnt( "trig_1", "targetname"); model_1 = GetEnt( "model_1", "targetname"); trig_1 waittill("trigger", player); level.easter_egg_finished ++; model_1 Delete(); trig_1 Delete(); } function two() { trig_2 = GetEnt( "trig_2", "targetname"); model_2 = GetEnt( "model_2", "targetname"); trig_2 waittill("trigger", player); level.easter_egg_finished ++; model_2 Delete(); trig_2 Delete(); } function three() { trig_3 = GetEnt( "trig_3", "targetname"); model_3 = GetEnt( "model_3", "targetname"); trig_3 waittill("trigger", player); level.easter_egg_finished ++; model_3 Delete(); trig_3 Delete(); } function easter_egg_ending() { if(level.easter_egg_finished == 3) { all GiveWeapon( INSERT_WEAPON_CODE_NAME_HERE); } }



down at the bottom of the GSC.

Replace the INSERT_WEAPON_CODE_NAME_HERE with the codename of the weapon you want.

in Radiant make 3 script models of the thing you want the players to shoot at, and give them the KVP of Targetname: model_1, Targetname: model_2, and Targetname: model_3.

create 3 trigger_damage and put them around the models you made and give them the KVP of Targetname: trig_1, Targetname: trig_2, and Targetname: trig_3.

Make sure they are matching their respective models, so trig_1 is around model_1 and so on.



Then compile your map and link and you should be good!

Like I said I made this in a hurry, and am not quite sure how the GiveWeapon function works so let me know if this is broken and hopefully I can fix it.