Save reset help

Hi I was working on a save file system and I got it working but I cant get the Reset to work.

If anyone can help I’m all ears.

Sincerely
William Boersma

Hi @WilliamBoersma31,

What do you mean with save reset? Can you explain what’s that supposed to do?

1 Like

@Leonidas I basically need a code that sets all the local storage back to false.
I tried this
if (this.app.keyboard.isPressed(pc.KEY_T)) {
local.Storage.setItem(‘DONE’, true)
}
and in a separate script
if (this.app.keyboard.isPressed(pc.KEY_R)) {
local.Storage.setItem(‘DONE’, false)
}

Hi @WilliamBoersma31,

It looks like you’re looking for localStorage.clear();

Check out this documentation for the localStorage API:

https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

1 Like

@eproasim Thanks it worked like a charm.

1 Like