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 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
What do you mean with save reset? Can you explain what’s that supposed to do?
@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)
}
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
@eproasim Thanks it worked like a charm.