Wiremod Damage Detector

I was scrolling through the GMOD Wiki and stumbled upon the damage detector, which I thought would greatly help me simulate damage on my contraptions. However, I found that the damage displayed by the detector was instantaneous. (In other words, the damage shown will reset to 0, instead of continuing to add up.) Is there anyway to make the damage detector add up the damage perhaps? A lua file edit or some tricky stuff with wire. Anything as long as it works. Thanx.

The damage detector does not use any set method to get a props health. All it does is return the damage that would be inflicted apon a prop if it were breakable from physical collisions and being shot.

If you put a damage detector on a door and shoot it, the damage detector will return the damage of your shot. If you want to implement this into a damage system I reccomend expression 2.



@Name lol
@Inputs Hit
@Persist Health

if(first()){Health=1000}
if(Hit){Health-=Hit}
if(Health<=0){Health=0}
if(Heahth==0){print("lol the prop just died")}


Damage wise, you could use that in conjuncion with propcore to delete props, however without propcore, you could use it to:

Color
Modify Alphas
Kick a player out of a pod (and adv pod’s other functions)
apply pretty effect trails to show damage (works well on airplanes)
applyForce
anything.
etc etc.

hope that helps

if(Health < 0){selfDestructAll()}