Sodarrific Posted January 8, 2022 Share Posted January 8, 2022 I've been trying to make a character that only takes one damage from attacks. I've been avoiding health absorption because it is inconsistent, but the method I have currently makes it so that they don't take damage at all. How do I control how much damage a character takes from all attacks? local function shielder(inst, data) inst.components.health:DoDelta(-1) end inst.components.health.absorb = 1 inst:ListenForEvent("attacked", shielder) Link to comment https://forums.kleientertainment.com/forums/topic/136796-super-armor/ Share on other sites More sharing options...
-LukaS- Posted January 8, 2022 Share Posted January 8, 2022 You can do this by overriding the GetAttacked function to always use 1 as the damage. local oldGetAttacked = inst.components.combat.GetAttacked inst.components.combat.GetAttacked = function(self, attacker, damage, weapon, stimuli) return oldGetAttacked(self, attacker, 1, weapon, stimuli) end 1 Link to comment https://forums.kleientertainment.com/forums/topic/136796-super-armor/#findComment-1531350 Share on other sites More sharing options...
Sodarrific Posted January 8, 2022 Author Share Posted January 8, 2022 This works perfectly. Many thanks! Link to comment https://forums.kleientertainment.com/forums/topic/136796-super-armor/#findComment-1531364 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now