Jump to content

Why can certain mobs be stunned and not others ?


Recommended Posts

Hello,

I have noticed certain mobs would keep getting stunned even from small hits (eg. regular spiders) while some others would not (spider warriors). When fighting a pig with a spear there is a stun effect preventing him from retaliating, even if I increase his HP. I would like to remove this effect.

Link to comment
Share on other sites

Thanks ! :)

For anyone wondering:

EventHandler("attacked", function(inst)
        if not inst.components.health:IsDead() then
            if inst:HasTag("spider_warrior") or inst:HasTag("spider_spitter") then
                if not inst.sg:HasStateTag("attack") then -- don't interrupt attack or exit shield
                    inst.sg:GoToState("hit") -- can still attack
                end
            elseif not inst.sg:HasStateTag("shield") then
                inst.sg:GoToState("hit_stunlock")  -- can't attack during hit reaction
            end
        end
    end),

 

Edited by Saiph
Link to comment
Share on other sites

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
 Share

×
  • Create New...