How to script a scoreboard clock

When I run it the timer does not change. I have linked it up to change the timer but it does not.

Excuse me, I admit wrong. I used the wrong symbol in the while loop, its checking for game time less than 0 instead of greater than. Flip the < to >.

I made the change and the clock still wont budge.

Do some debugging then. I have warned you that this is sample code and should not be used as the basis for your game. I am not going to hold your hand through this process either. The posts above provide significant information: it is up to you to interpret it. Not just mine, but everyone elseā€™s.

I think its because the gametime value starts at 0 and then you are checking for one greater then 0 but since its 0 it does not run.

I figured it out! Thanks so much!

1 Like

When your putting it in time. Shouldnā€™t you be putting it in seconds?

Yes. When working with time in scripts, often you will either be using seconds or milliseconds depending on your circumstances. The code samples Iā€™ve provided in this thread work in seconds.

1 Like