How do I webstorage with integers {SOLVED}

Get help using Construct 2

Post » Fri Jan 09, 2015 10:28 pm

Can someone show me the proper way to STORE and RETRIEVE a VAR that is a number


I have a global lives = 3 and when I try to get the value it comes out as Nul assuming it's not getting the integer aspect of it?


would it be something like webstorage.LocalValue(int("lives"))???
Last edited by desjardins2014 on Fri Jan 09, 2015 11:13 pm, edited 1 time in total.
Need Sprites For Your Next Project?
100% Vector Animated Sprites
B
8
S
2
Posts: 170
Reputation: 1,086

Post » Fri Jan 09, 2015 10:50 pm

Try int(webstorage.LocalValue("lives")). You don't want to turn the "lives" key into an int. You need to return the result with the lives key first and thenturn "3" string to be a 3 int.
B
32
S
7
G
2
Posts: 317
Reputation: 2,851


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 67 guests