Arched 1 Posted December 14, 2014 Hello ther I've been looking around everywhere and I can't seem to find what I'm looking for anywhere So I wanted to trigger a car explosion once you shoot it with a sniper rifle. So I thought the best to do it was a HandleDamage EH, however I have no clue how to do it cause I've never worked with EHs before, so how should I do this? Any help is appreciated Thanks in advance, Cheers Share this post Link to post Share on other sites
dreadedentity 278 Posted December 14, 2014 You'll want to add the event handler, and check that the bullet is the same kind fired from sniper rifles. If it is, set the car damage to 1. this addEventHandler ["HandleDamage", { private "_return"; _return = 0; //car is invincible unless conditions are met if (isPlayer (_this select 3)) then //shot must be from a player/prevents AI fluke { if ((_this select 4) == "RIFLE_BULLET_CLASSNAME") then //additionally, the ammo used must be correct. { _return = 1; //allow engine to handle setting the damage, you could also use (_this select 0) setDamage 1; it would do the same thing }; }; _return; }]; Use a "Fired" event handler to get the classname of the bullet you want to use: //add to player this addEventHandler ["Fired", { hint (_this select 4); }]; Share this post Link to post Share on other sites
jshock 513 Posted December 14, 2014 Or just a HitPart, does all the same without the second EH. Share this post Link to post Share on other sites
Arched 1 Posted December 14, 2014 Nice, it worked perfectly Thanks for the help :D Share this post Link to post Share on other sites