Jump to content
Sign in to follow this  
Catchdog64

Script to remove weapons and ammo from dead NPC's

Recommended Posts

I have searched and searched and cannot find help with what I'm trying to do. I'm making a mission where the players start off as prisoners, and a rescue team comes and breaks them out. I don't want them to be able to loot the guards so I want the weapons and ammo to disappear from the corpses. For the life of me I can't get the scripting to work in the init of the guards. This is what I have.

 

this addEventHandler ["Killed", {
 _this removeAllweapons; _this removeAllMagazines;}]
 

Share this post


Link to post
Share on other sites

this addEventHandler ["Killed", {

_this removeAllweapons; _this removeAllMagazines;}]

Inside the handler _this is an Array. Use (_this select 0).

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers

Edit:

https://community.bistudio.com/wiki/removeAllWeapons

removeAllWeapons (_this select 0);

etc.etc.

btw. removeAllMagazines is not an existing command ;) use something else...

Share this post


Link to post
Share on other sites

It removed them all anyway, thanks a million. Really my first time trying to get my head around this stuff.

Share this post


Link to post
Share on other sites


   this addEventHandler ["Killed",{

    

        params ["_courpse"];

    

            [_courpse] spawn {

            

                params ["_deadbody", "_droppedGear"];

                _droppedGear = nearestObjects [_deadbody, ["WeaponHolder", "WeaponHolderSimulated", "GroundWeaponHolder"], 10];

                sleep 5;

                {deleteVehicle _x} forEach _droppedGear + _deadbody;

            

            };

    }];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×