I spent quite a bit of time searching for a suitable method to make zombies invulnerable to all damage but headshots. So I thought I would share the solution I discovered.
Visit this topic: http://www.tunngle.net/community/to...l__+zombie++damage__fromsearch__1#entry927641
You want to grab the code from post #1, and follow the instructions for using it in post #18, along with the directions below:
- Grab all of the code from fn_damageHandlerZ.sqf (found in the DayZ Code/compile folder), and paste it into a new Notepad++ document, which you will name fn_damageHandlerZ.sqf . I saved mine to my server mission .pbo fixes folder.
- Now paste the code from post #1 in the link above into your newly created fn_damageHandlerZ.sqf as shown in post #18. Save the file.
- If you haven't done so already, move your compiles.sqf from the DayZ Code .pbo to your server mission .pbo. To do this, just copy the contents of the compiles.sqf into a new notepad++ document and save it into your fixes folder or wherever you prefer inside your server mission .pbo. Then open up your init.sqf and find the following:
You want it to look like this:
- Open your newly created compiles.sqf and scroll down until you find a line that begins with this (should be line #392):
- Make that line look like this:
- You're all finished. If you like, you can open your newly created fn_damageHandlerZ.sqf and adjust the damage values to your liking. By default, zombies still fall to broken legs, but can get back up. I like this because while a zombie can only die to a headshot or explosion, you can still slow them down by breaking their leg(s).
Visit this topic: http://www.tunngle.net/community/to...l__+zombie++damage__fromsearch__1#entry927641
You want to grab the code from post #1, and follow the instructions for using it in post #18, along with the directions below:
- Grab all of the code from fn_damageHandlerZ.sqf (found in the DayZ Code/compile folder), and paste it into a new Notepad++ document, which you will name fn_damageHandlerZ.sqf . I saved mine to my server mission .pbo fixes folder.
- Now paste the code from post #1 in the link above into your newly created fn_damageHandlerZ.sqf as shown in post #18. Save the file.
- If you haven't done so already, move your compiles.sqf from the DayZ Code .pbo to your server mission .pbo. To do this, just copy the contents of the compiles.sqf into a new notepad++ document and save it into your fixes folder or wherever you prefer inside your server mission .pbo. Then open up your init.sqf and find the following:
Code:
call compile preprocessFileLineNumbers "\nst\ns_dayz\code\init\compiles.sqf"; //Compile regular functions
progressLoadingScreen 1.0;
You want it to look like this:
Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf"; //Compile regular functions
progressLoadingScreen 1.0;
- Open your newly created compiles.sqf and scroll down until you find a line that begins with this (should be line #392):
Code:
local_zombieDamage
- Make that line look like this:
Code:
local_zombieDamage = compile preprocessFileLineNumbers "fixes\fn_damageHandlerZ.sqf";
- You're all finished. If you like, you can open your newly created fn_damageHandlerZ.sqf and adjust the damage values to your liking. By default, zombies still fall to broken legs, but can get back up. I like this because while a zombie can only die to a headshot or explosion, you can still slow them down by breaking their leg(s).