The health.lua isn't really the best script for health in games. It seems they keep reverting the changes we sent them too over github years ago. Likely due to new DLCs making those changes. I remember fixing that one myself a while back so that it doesn't go into negatives or above maximum. But looks like its reverted back to being a buggy mess. Technically you should be able to set the value of health within the editor and not with opening up either Lua files or FPE files. Unfortunately this is not the case with this stock script.
Anywho, the
health.lua script currently uses
AddPlayerHealth(e) command which references the FPE file of the health item entity. The line that says "
quantity = 10" for example. If you are using a custom entity, it wont give any health and may instead hurt the player because its trying to locate the value of quantity and because this line doesn't exist, it doesn't have a value of 0 even instead its
nil, so it hurts the player instead.
For example take a look at the medkit entity FPE file in entitybank\Collectables\medkit.fpi , it has a quality value of 250 and there heals the player by 250.
If you are using a custom entity as a health object, edit that objects FPE file and add a quantity line. For example:
quantity = 10
It will then heal the player when you collect it.
EDIT: as Amen just said, compare your entities FPE file with the stock ones, like the medkit or chips for example
Store Assets -
Store Link
Free Assets -
Resource Link
i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960