How do I make a variable decrease even when the project isn't open

helpwithcode

#1

I’m trying to do a game like pou (I bet all of you know it!), where, when time passes, your hunger amount starts getting higher, but I believe I need to include a clock code in the game to make it work!
@Awesome_E
@CreationsOfaNoob
@CodeHelp
@everyone_who_knows_how_to_do_this


#2

Wow that was quick


#3

@Petrichor uses a hidden block called the WaitTilTimestamp block, but idk how to get it, ask him maybe?


#4

So like the exact time?


#5

Yes, but not that exact, just the minutes and hours


#6

I’m going to post a wip…


#7
  1. Find out the set speed block for the time rate of 60 seconds per minute
  2. Make a clock out of shapes, numbers, etc.
  3. Make your click hand move

The time rate of 60 should be a variable, so you can use a variable to get the hand to move


#8

I got something similar.


#9

Ah ok IDK how to do that****


#10

Just use a time passed variable for each stat and reset when filled


#11

You don’t need a timestamp for something like that.
You could code

Repeat Forever
Wait (5000) milliseconds
Increase (Health) by -1


#12


Here’s the wip,


#13

Yeah but I want it to work still the game is not opened


#14

The h e c k is this? Lol confused


#15

So you will lose health while the game is paused (not opened)?


#16

Yeah! Now you’re getting it


#17

Something like this!


#18

Lol that’s a big troll haha
Interesting

Repeat Forever
Increase (Health) by ((Current Timestamp)-(Start Timestamp))


#19

I get what you want now you could probably do something like
Time + 1
Divide by 60 = hours
Modulo 60 = minutes


#20

Also, HOW THE H E C K YOU USE MODULO!?