- Dec 11, 2017
- 250
- 1,060
Hi!
I've got a tiny issue with an if statement in screens.
There's a map with locations in my game that players can go to and I want some of them to be closed on weekends so I created a weekend variable that works perfectly, it sets itself on true whenever there's a weekend in-game.
Then I've got my imagebutton that stands for a location. Period stands for a time of day - 0 is morning, 2 is night. If condition works for day periods, the location is closed at night but somehow it doesn't work for weekend. I placed the weekend condition above the period ones to make sure this condition is checked first.
imagebutton:
if weekend:
action Jump("closed")
if period == 0 or period == 1:
action Jump("opened")
elif period == 2:
action Jump("closed")
Can someone tell me why it's not working?
Edit: nvm, fixed it
I've got a tiny issue with an if statement in screens.
There's a map with locations in my game that players can go to and I want some of them to be closed on weekends so I created a weekend variable that works perfectly, it sets itself on true whenever there's a weekend in-game.
Then I've got my imagebutton that stands for a location. Period stands for a time of day - 0 is morning, 2 is night. If condition works for day periods, the location is closed at night but somehow it doesn't work for weekend. I placed the weekend condition above the period ones to make sure this condition is checked first.
imagebutton:
if weekend:
action Jump("closed")
if period == 0 or period == 1:
action Jump("opened")
elif period == 2:
action Jump("closed")
Can someone tell me why it's not working?
Edit: nvm, fixed it
Last edited: