Call of Duty: Black Ops III

Call of Duty: Black Ops III

Not enough ratings
[Scripting] Make Grenades Givie Points When Thrown Into Trigger
By Mysti and 1 collaborators
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hey everyone. We're back at it again with another "useless" tutorial. Either or, no messing about. You've played Mob of the Dead before, you throw a grenade into a lava pit and get 20 points. This is the exact same. So let's go!
Radiant Requirements
Yep, this requires a simple Trigger, so we're going to need to load up Radiant and place it where we want the players to throw the grenades to get the points.

So, place a trigger_use where you'd like them to throw their grenades, and give it the follow KVP:
Key
Value
targetname
point_trigger

Save the map and close, we're done with Radiant.
Scripting Requirements
This is where the magic begins. Again we're going to be hooking the player spawned callback, to do this put this line
callback::on_spawned( &on_player_spawned );
below
level.pathdist_type = PATHDIST_ORIGINAL;

Then at the bottom of the file, put this function

function on_player_spawned() { self endon("disconnect"); self endon("death"); do { self waittill("grenade_fire", Grenade, Weapon); if(Weapon.rootweapon == GetWeapon("frag_grenade")) //You'll Need To Add More Checks For Stickies, Stielhandgranate, Or Other Ported Grenades. { Grenade thread dispose_of_grenade(self); } wait .5; } while(true); }
As you see I am only checking for frag_grenade which is the default type of grenade, you also see my comment. If you want this towork you'll need to add a whole mess of conditional checks for the other grenades for it to work.

Now below that you want to add the function that is actually disposing of the grenade and giving the player his hard earned points.

function dispose_of_grenade(Player) { Point_Origin_Trigger = GetEnt("point_trigger", "targetname"); Flag = true; while(Flag) { wait .25; if(self IsTouching(Point_Origin_Trigger)) { player zm_score::add_to_player_score(20); self delete(); Flag = false; } } }
Final Words
We might not be getting MOTD in Chronicles, but that isn't stopping me from showing people how a basic feature like this works from a scripting POV, I hope it's simple to follow as usual, any questions ask and I'll try my best to help.

Thanks, Johnathon.
3 Comments
「Crash」 17 May, 2018 @ 6:02pm 
MOTD IN B04 LETS FUCKING GOOO
costas 17 May, 2018 @ 12:31pm 
WE WILL BE GETTING MOTD REMASTERED IN BO4!!!!
Pepsi 16 May, 2018 @ 7:17am 
Do Not Forget To Add
#using scripts\zm\_zm_score;
At the top of your file!