Jump to content
Sign in to follow this  
Gareth_Sims

Adding Hunger/Thirst

Recommended Posts

Hi guys, I have looked around and cant seem to find what I am looking for, Does anyone know how to add a thirst/hunger system and consumables like dayZ and Wasteland have to a custom mission that I am making.

Cheers in advance

Gareth

Share this post


Link to post
Share on other sites

Hunger/Thirst is basically just a variable that is ticking in a loop

player setVariable ["thirst", 0, false];//Initial setup of variable

//while the player is alive
while {alive player} do {

//Get variable
_thirstvar = player getVariable "thirst";

//+1
_thirstvar = _thirstvar + 1;
//Apply to thirst
player setVariable ["thirst", _thirstvar, false];


//wait one second
sleep 1;		


};






Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×