How can I cancel damage or return it as 0 in Lua using OnEntityTakeDamage?
I believe it's possible in C# this way:
Code:info.damageTypes = new DamageTypeList(); info.HitMaterial = 0; info.PointStart = Vector3.zero;
Cancel damage using OnEntityTakeDamage? (Lua)
Discussion in 'Rust Development' started by mvrb, Oct 16, 2015.
-
Wulf Community Admin
From the Docs:
- Returning a non-null value overrides default server behavior (useful for godmode etc.)
-
Thanks!
[DOUBLEPOST=1444953760][/DOUBLEPOST]- It should be okay to set the damage to 0, but if you don’t return non-null, the player’s client will receive a damage indicator (if entity is a BasePlayer)
I can currently fall from far up which doesn't damage me, but it shows that I am bleeding.
I currently return true
[DOUBLEPOST=1444955016][/DOUBLEPOST]Never mind, I found an alternative.
Thanks for your help.Last edited by a moderator: Oct 16, 2015
