How do I ADD value to local key webstorage.

Get help using Construct 2

Post » Tue Feb 10, 2015 11:46 pm

EDIT: SOLVED - check below

I need to update the web storage local key with +1 when the player collides with an object.

So basically I want this:

On collision > WebStorage - Set local key "crowns" to WebStorage.LocalValue("crowns")+1

Problem is, when I add the "+1" it says "type mismatch".

I'm sure there's a bit of code that i need to add before of after.

Solution: I just updated the code to int(WebStorage.LocalValue("crowns"))+1
Last edited by cioclod on Tue Feb 10, 2015 11:52 pm, edited 1 time in total.
B
7
S
1
Posts: 39
Reputation: 507

Post » Tue Feb 10, 2015 11:49 pm

You might try int(WebStorage.LocalValue("crowns")) + 1
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Tue Feb 10, 2015 11:53 pm

codah wrote:You might try int(WebStorage.LocalValue("crowns")) + 1



Haha, you typed the answer as I was editing my post that I solved it. Thank you anyway :)
B
7
S
1
Posts: 39
Reputation: 507


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests