TigerPrascire Posted May 25, 2017 Share Posted May 25, 2017 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. Link to comment https://forums.kleientertainment.com/forums/topic/79139-how-to-make-an-attack-action-cost-hunger/ Share on other sites More sharing options...
TigerPrascire Posted May 25, 2017 Author Share Posted May 25, 2017 Sorry, that's attacker.components.hunger:DoDelta(attacker.hunger.current - 3) Link to comment https://forums.kleientertainment.com/forums/topic/79139-how-to-make-an-attack-action-cost-hunger/#findComment-924969 Share on other sites More sharing options...
alainmcd Posted May 25, 2017 Share Posted May 25, 2017 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? Link to comment https://forums.kleientertainment.com/forums/topic/79139-how-to-make-an-attack-action-cost-hunger/#findComment-924989 Share on other sites More sharing options...
TigerPrascire Posted May 25, 2017 Author Share Posted May 25, 2017 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! Link to comment https://forums.kleientertainment.com/forums/topic/79139-how-to-make-an-attack-action-cost-hunger/#findComment-924990 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