So I'm making a game and in my game there is a daily question. I change the daily question every day. I made a bool value inside the player and every time the player answers the daily question the bool value turns true. How do I set the bool value to false after I change the daily question of the day? Do I have to make a new variable every day? There's no need for me to display any script because everything's working fine. I'm just wondering how to do this. Please help (=
How to set a saved bool value to false after daily question changed?
1 answer
It's not reasonable to do this with just a bool value.
Instead, you could store which question they last answered. Every day, you increase the question count.
Thus if the current question ID is 143 and the player's last-answered-question is 143, you know they solved today's question. If their last-answered-question is 130, then you know they didn't yet answer today's question.
It could be tedious to increment the question yourself, so you could also just use the timestamp using os.time(). If the player's last-answered-timestamp is before the last-posted-question's timestamp, then they haven't answered it yet. If it's equal to (or after) then they have answered it.
1 comment
Yeah... Thanks very much. This did help a lot. I just thought it would be a bit more easy /: But you definitely answered my question (:
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
wait(86400) --code
Rephrased my question XD