So i've been having trouble with add variable points where I need to click certain imagebuttons tu get enough points to unlock another imagebutton
This is my code:
init python:
points = 0
unlock_button2_points = 3
screen store():
add "images/mapscreens/sto.png"
if button_visible2 and points < unlock_button2_points:
imagebutton:
focus_mask True
auto "images/Mapscreens/stot_%s.png" action [ToggleScreen("store"), Jump("cashier_1"), SetVariable("points", points + 1)]
screen gasrestroom():
add "sscene5"
if not unlock_button2_points:
imagebutton:
focus_mask True
auto "images/mapscreens/gasrestroom_%s.png" action [ToggleScreen("gasrestroom"), Jump("restroomin"), if points >= 3: SetVariable("unlock_button2_points", True)]
label_whatever
if unlock_button2_points:
"You've unlocked the second button!"
If put
if points >= 3: SetVariable("unlock_button2_points", True)]
the game crashes
and if I delete it
the game just keeps the variable frozen
This is my code:
init python:
points = 0
unlock_button2_points = 3
screen store():
add "images/mapscreens/sto.png"
if button_visible2 and points < unlock_button2_points:
imagebutton:
focus_mask True
auto "images/Mapscreens/stot_%s.png" action [ToggleScreen("store"), Jump("cashier_1"), SetVariable("points", points + 1)]
screen gasrestroom():
add "sscene5"
if not unlock_button2_points:
imagebutton:
focus_mask True
auto "images/mapscreens/gasrestroom_%s.png" action [ToggleScreen("gasrestroom"), Jump("restroomin"), if points >= 3: SetVariable("unlock_button2_points", True)]
label_whatever
if unlock_button2_points:
"You've unlocked the second button!"
If put
if points >= 3: SetVariable("unlock_button2_points", True)]
the game crashes
and if I delete it
the game just keeps the variable frozen