Neu7ral Posted September 7, 2016 Share Posted September 7, 2016 There's a way of disabling stunlock via a tag? I saw something on stategraphs, but actually don't know how to use postinits ;_; Link to comment https://forums.kleientertainment.com/forums/topic/70020-help-stunlock-immunity/ Share on other sites More sharing options...
. . . Posted September 7, 2016 Share Posted September 7, 2016 Put this in modmain AddStategraphPostInit("wilson", function(sg) local _attacked = sg.events.attacked.fn sg.events.attacked.fn = function(inst, data) local old_stunlock = nil local attacker = nil if inst.DontGetHit then data = data or {} attacker = data.attacker data.attacker = data.attacker or {} data.attacker.components = data.attacker.components or {} data.attacker.components.combat = data.attacker.components.combat or {} old_stunlock = data.attacker.components.combat.playerstunlock data.attacker.components.combat.playerstunlock = GLOBAL.PLAYERSTUNLOCK.NEVER inst.sg.timeinstate = 0 end _attacked(inst, data) if inst.DontGetHit and attacker and attacker:IsValid() then attacker.components.combat.playerstunlock = old_stunlock end end end) For not getting stunlock inst.DontGetHit = true -- No stunlock inst.DontGetHit = false -- Take stunlock Credit to DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/70020-help-stunlock-immunity/#findComment-811142 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