So in my new game that I’m creating, I want to make it so that the player gets a potato every second, I tried using “1*TimeDelta()” but it gives a lot of numbers after the decimal point like this:
I want to make it so that it’s just the number of potatoes (3 in the photo), without the numbers after the point (449439999999907 in the photo).
Please help! Thanks!
You can use the round or trunc functions. Round will round up the number, and trunc will just chop off the number after the decimal point.
You could do no condition event Change value of variable PotatoTimer add 1000*TimeDelta. Then another event block, variable PotatoTimer equal or greater than 1000, change variable PotatoQuantity add 1, change var PotatoTimer set to 0.
You could do, no condition event Change var Time set to Time(“timestamp”). Condition event, var PotatoTimer=0 change var PotatoTimer set to Time(“timestamp”)+1000. Another condition event, var PotatoTimer equal or greater than var Time, change var PotatoQuantity add 1, change var PotatoTimer set to 0.
Yeh I’m bored at work
Thanks, I tried trunc and it worked.
I did it with the answer of @MrMen, but thanks for helping!