"localStorage" isn't saving (FIXED)

Fill this out this info to make it easier for the community to help you! If you don’t fill out this information, your post may be deleted or removed.

What Wick Editor Version are you using?
1.19.3 still.

Describe the Problem
localStorage is not saving the variable.

What have you tried so far?
Checking if its null/not existing
My code is this:

project.localStorage=window.localStorage;
//currency
if (project.localStorage.bul===null || isNaN(project.localStorage.bul)){
project.localStorage.setItem("bul", 5);

}
project.bullets=parseInt(project.localStorage.bul);

Have a read here
you have both cookies and local storage wick samples

2 Likes

Try replacing

with

project.localStorage.getItem("bul")
if (project.localStorage.getItem("bul")===null){
    project.localStorage.setItem("bul", 5);
    
}

project.bullets=project.localStorage.getItem("bul")

It still returns null

I’m not sure but project.localStorage is a project variable and will be deleted after you stop the wick player.
It seems to me you are not updtating browser localStorage

This is all fixed now. (finally I can rest)