Give a player gifts if he plays the game every day... how?

Hallo. How can I give a gift to a player, who play the game regurarly, like for each day he plays, he get 1000 monay. How to do that ?:wink:

Perhaps a couple of variables, one to track if the player has played today, and another to track the number of days in a row they play.

From there, itโ€™s just a matter of getting the system time/date, loading, updating, and saving it on launch, and an if statement to to check if the player has met your criteria, and award the gift.

Use System.DateTime.Now. So for example, just before a game session ends, insert this:

var lastDay : int = System.DateTime.Now.get_Day();

And then, when a player relogs back in, in your Start () function, check whether itโ€™s been less than a day since they were last on:

function Start () {
	if (System.DateTime.Now.get_Day() - lastDay == 1) {
		Debug.Log("Have lotsa money!");
	}
}

That should work. :slight_smile:

Hope that helps, Klep