Damage player ignoring armor

Place to get help with not working mods / modding interface.
Post Reply
Villfuk02
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 30, 2018 7:23 am
Contact:

Damage player ignoring armor

Post by Villfuk02 »

Is there a way to damage a player, while ignoring all armor and possibly even shields?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Damage player ignoring armor

Post by eradicator »

Just directly change health?
LuaEntity.health = LuaEntity.health - Damage

Villfuk02
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Mon Apr 30, 2018 7:23 am
Contact:

Re: Damage player ignoring armor

Post by Villfuk02 »

Yep, I also figured that out. But i wanted to know if there was a better way. Thanks

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Damage player ignoring armor

Post by eradicator »

Villfuk02 wrote:Yep, I also figured that out. But i wanted to know if there was a better way. Thanks
Doesn't get much better than one line of code :P, and your description pretty much says "LuaEntity.damage()" doesn't work for me. So, NP ;)

Post Reply

Return to “Modding help”