# Saving Data When Closing Game

**URL:** https://forum.makecode.com/t/saving-data-when-closing-game/45697
**Category:** Help
**Tags:** extension, game
**Created:** [September 3, 2026, 2:17am UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697 "2026-09-03T02:17:01Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [September 3, 2026, 2:17am UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/1 "2026-09-03T02:17:01Z")

</div>

So, I was wondering if anyone knows a way to save data and reload it even if closing the game?  
I tried using the **better settings** extension and the **password-save** extension, but no of these seemed to keep data if I close and reopen the game.

I’m trying to make a profile extension/game where if you click the login button and type in some details, it should reload your data/profile. Though it seems when I tried doing this, the simulator would not remember the data.  
@richard @WoofWoof

---

<div class="post-metadata">

### Author: ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)
#### Post date: [September 3, 2026, 6:12pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/2 "2026-09-03T18:12:26Z")

</div>

Better settings should do this, you just have to refference the setting on startup and make sure you set the setting every once and a while, or when you press a save button in the menu or something like that.

---

<div class="post-metadata">

### Author: ![Hulahoop](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/hulahoop/32/25398_2.png) [@Hulahoop](https://forum.makecode.com/u/Hulahoop)
#### Post date: [September 3, 2026, 6:12pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/3 "2026-09-03T18:12:29Z")

</div>

Honestly im ready to see what the answer is because i kinda wanna do the same.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [September 3, 2026, 6:12pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/4 "2026-09-03T18:12:37Z")

</div>

They should save data when reloading and closing the game and stuff. Not if you switch devices or reset the cookies though. If you aren’t deleting cookies, something might be wrong with your code, so you should share it and we can help.

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [September 3, 2026, 6:13pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/5 "2026-09-03T18:13:46Z")

</div>

there’s no way for us to know if someone is closing the page or quitting their browser, so it’s not really possible to do this as you’re describing.

you can, however, just save state continuously in a forever loop like @Rune mentioned. that’s probably the best way to replicate this behavior.

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [September 3, 2026, 6:15pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/6 "2026-09-03T18:15:32Z")

</div>

oh wait, i think i misunderstood. the data should absolutely be getting saved if you’re using the settings or better settings extension. one thing to note though is that we base the settings on the name of the project so if you change that the settings will appear to get wiped out

if that’s not what’s happening, please share your code

---

<div class="post-metadata">

### Author: ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)
#### Post date: [September 4, 2026, 2:28am UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/7 "2026-09-04T02:28:03Z")

</div>

idk, but these work:

> **[save boolean](https://arcade.makecode.com/S79211-91502-40674-31519)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

> **[save number](https://arcade.makecode.com/S56633-02764-38806-97149)**
>
> has comments :)

---

<div class="post-metadata">

### Author: ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)
#### Post date: [September 4, 2026, 2:28am UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/8 "2026-09-04T02:28:14Z")

</div>

so I could create a project with the name of another one, and I can cheat a game?

---

<div class="post-metadata">

### Author: ![Air](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/air/32/26413_2.png) [@Air](https://forum.makecode.com/u/Air)
#### Post date: [September 4, 2026, 2:28am UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/9 "2026-09-04T02:28:49Z")

</div>

better settings extension should do it.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [September 4, 2026, 4:17pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/10 "2026-09-04T16:17:10Z")

</div>

I don’t think so. It’s per project, but code in the project deletes all settings if the name is ever different than last time it was run. This is so that settings from a different game will get deleted on _hardware_.

---

<div class="post-metadata">

### Author: ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)
#### Post date: [September 5, 2026, 6:38pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/11 "2026-09-05T18:38:33Z")

</div>

i might be to late to this but @richard isent there a way to check if you press reset so it does that and then resets so kinda in a way saving when reset

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [September 5, 2026, 9:18pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/12 "2026-09-05T21:18:16Z")

</div>

I just tested Voxel’s saving test and it did save even if I closed the simulator/game!

---

<div class="post-metadata">

### Author: ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)
#### Post date: [September 5, 2026, 11:43pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/13 "2026-09-05T23:43:17Z")

</div>

long story short, it saves every time the value was changed

---

<div class="post-metadata">

### Author: ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)
#### Post date: [September 5, 2026, 11:44pm UTC](https://forum.makecode.com/t/saving-data-when-closing-game/45697/14 "2026-09-05T23:44:02Z")

</div>

i have changed the 2 projects, so there technically smaller now.
