+Chaman Calle Posted May 5, 2016 Share Posted May 5, 2016 I have a countdown and a list of tasks that had to be performed while the time ticks away. However, every time you complete a task, there's some bonus time. I have tried the function "increment/decrement... Crono.Remaining + 15". However, it does not work properly. How can I solve this? Is there any luacode that works fine? Thank you! Quote Link to comment
Ranger Fox Posted May 5, 2016 Share Posted May 5, 2016 Off the top of my head, you might be able to do it this way: -- Store the total number of seconds a user has in a variable. Any bonus time would be added to this. -- Create another variable to store the number of seconds elapsed. -- Use a one second timer. Every second, increment the number of seconds elapsed and check that against the total number of seconds variable. -- If the user still has time, start the timer again. Note the way described above might give the user an extra second of time due to the additional processing time accrued over the long run while checking the variables and starting the timer. I could think more on this later, but that's a quick idea I had. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.