Jump to content

Recommended Posts

So, I've pretty much completed my mod aside from one thing. I would like to make the custom attack for my character cost around 3 hunger each time you used it. The attack works perfectly but I cannot figure out the code for providing a negative value of hunger each time they use it, I just get an error message saying that hunger is a nil value each time which means I assume I'm calling that value incorrectly. I'm probably just an idiot, can anyone give me a hand?

attacker.components.health:DoDelta(attacker.hunger.current - 3)

that is the line I'm trying to use.

The error you're receiving is probably because you're using attacker.components.hunger:DoDelta(attacker.hunger.current - 3) instead of attacker.components.hunger:DoDelta(attacker.components.hunger.current - 3). However, what you want to use is attacker.components.hunger:DoDelta(-3), isn't it?

2 minutes ago, alainmcd said:

The error you're receiving is probably because you're using attacker.components.hunger:DoDelta(attacker.hunger.current - 3) instead of attacker.components.hunger:DoDelta(attacker.components.hunger.current - 3). However, what you want to use is attacker.components.hunger:DoDelta(-3), isn't it?

yeah, thanks!

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