Jump to content

Recommended Posts

So, I'm pretty new to modding and am currently working on one with my friend. I'm handling part of the code, and we would the effect that is on the title, however, I have very little experience and no idea how to make that happen: the player character unable to hit an enemy that isn't moving, missing the hit, or causing 0 damage, or something like that.
So, is it possible? How would I be able to do that? 

Well, by trial and error I figured out how to make the ''don't damage the enemy'' part by reducing my own attack multiplier to 0. Problem is, I can't get it back to the normal state. So once I attack an idle enemy, my damage is going to be 0 for the rest of the game. Any ideas on how I can make this work?

This is what I'm doing:

    inst:ListenForEvent ("onattackother", function (inst, data)
      if data.target.sg:HasStateTag("idle") then
         inst.components.combat.damagemultiplier = 0 
          return
        
end
end)

I'll eye ball it and say try this

 inst:ListenForEvent ("onattackother", function (inst, data)
      if data.target.sg:HasStateTag("idle") then
         inst.components.combat.damagemultiplier = 0 

else

inst.components.combat.damagemultiplier = 1
          return
        
end
end)

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...