Jump to content

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...