Character stats assigning a multi use function

Hello,

I’m messing about with hunger and stamina system for now, I will add more later, but I was trying to build a function that take part of the leg work out of the job, rather than a function for each varible.

So far it looks like this: http://puu.sh/stO4t/816b3ff939.jpg

I’m aware that it might be incorrect as the “Set player hunger” should be “Set Varible that’s passed through”.

Here’s what the pickup item looks like: http://puu.sh/stO83/2e1abc842b.jpg

So when a player picks up food, batteries, health or what ever, I can just feed this a current value, the max value, and the amount that i want added or subtracted.

I’m also aware I have 2 cast to third persons, I’m still a noob at this and trying to figure out how to make this system modular, if you can at all, I don’t want to create tons of functions for different stats, hunger, health, stam, battery, it’s not much but it triggers my OCD.

Let me know if you need more information,

Thanks for your time.