Jump to content
Sign in to follow this  
somecallmenomad

Code to make bodies dissapear?

Recommended Posts

Could someone make me a quick script that makes bodies of people (Just enemies, or in this case, Opfor) disappear after they die? I don't want the players of my mission to loot them.

Share this post


Link to post
Share on other sites

Add this code in init field of unit:

this addEventHandler ["Killed", {hideBody (_this select 0)}];

Or, if units are created by script, insert this code in script:

_unit addEventHandler ["Killed", {hideBody (_this select 0)}];

Edited by Schatten

Share this post


Link to post
Share on other sites

If the units are placed via editor add this to their init field (in the editor):

if(isServer)then{this addEventHandler["killed",{hideBody (_this select 0)}]};

If the Units are created by a Script, add this line of code after the unit is created:

//We assume that the handler for the created/spawned unit is "_unit"

_unit addEventHandler["killed",{hideBody (_this select 0)}];

/Edit

Ninja'd by Schatten

Greez KiloSwiss

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  

×