• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to save and load currency

D

darkalbo

Guest
When i make the player hit the coin i get this, i made a scrip to save currency and load it but i dont think i did it right.

FATAL ERROR in
action number 2
of Step Eventobj_p1
for object obj_coin:

Push :: Execution Error - Variable Get -5.money(100001, -2147483648)
at gml_Object_obj_coin_CollisionEvent_11_2 (line 1) - global.money += 1
 
K

Kenjiro

Guest
Looks like you haven't set the initial value for global.money.

Usually you'd do this in your create event.

Code:
global.money = 0;
 
Top