# Preform task before reset

**URL:** <https://forum.makecode.com/t/preform-task-before-reset/31022>\
**Category:** Help\
**Tags:** game, extension\
**Created:** [October 6, 2024, 8:23pm UTC](https://forum.makecode.com/t/preform-task-before-reset/31022 "2024-10-06T20:23:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobbyZero](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/robbyzero/32/17188_2.png) [@RobbyZero](https://forum.makecode.com/u/RobbyZero)\
**Post date:** [October 6, 2024, 8:23pm UTC](https://forum.makecode.com/t/preform-task-before-reset/31022/1 "2024-10-06T20:23:31Z")

</div>

So I want to be able to perform an auto-save in my game. But doing it every time my game updates will cause lag. In addition, I could use the “on game update every x second” but that means players will have to wait for it to happen before they can close out the tab. So, I thought maybe I could do it right before someone clicks reset. However, there is no function to do that. Is there an extension I could use to let me save the game before a reset and then reset when it’s finished?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 7, 2024, 2:54pm UTC](https://forum.makecode.com/t/preform-task-before-reset/31022/2 "2024-10-07T14:54:25Z")

</div>

I think it is easier to just do it the “cookie clicker way”, where it auto-saves every once in a while, but then provide a method to the user to save now. Similar to how I do it in Fossil Clicker:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/2/324b26f08ab35a981a0fc9e3094ca62816e7d2b2.png)

(I was lucky enough to time the “Saved game successfully” notification hehe)
