# Help with comparing stop watch times!

Hello! I really need some help on how I would go about doing this! I am trying to save the time on a stopwatch that I have made and I need help on how I could make this possible!

Screen Shot 2020-07-10 at 8.38.22 PM|522x500

I am really stuck and I don’t really know, BUT, How would I compare and or do greater than or less than with three numbers?
Ie.

1. 2:15.9 > 1:23.1

How would I go about doing this?
-Panzerv1

2 Likes

Just convert the actual recorded time to seconds, (or milliseconds) and compare that way.

1 Like

I have converted each one of the times
Minutes, Seconds, and Milliseconds, but how would I write if statements for them?

1 Like

I have to either compare all 3 together or I have to write a bunch of if statements. That is why I posted this

1 Like

I think the or statement would be most fitting for this.
` if Value1 > Value2 or Value1 > Value3 then` something like this ?

1 Like

Oh! Thank you! i might be able to use these. BUT, is the “or” statement possible to use with 3 variables?What about the and statement?
Thanks!
-Panzerv1

1 Like

I don’t understand your question, plz rephrase it

1 Like

I have three times, Minutes, seconds, and milliseconds. I need to be able to compare a time the player gets from a time trial to the medal times (GOLD, SILVER, BRONZE TIMES). For example:
GOLD TIME = 1:05.0
Player gets 1:02.5

How do I get all three values and compare them to each other so that I can give credits based on the times players get. Does that work? pls lmk
-Panzerv1

2 Likes

I recommend you ditch the system you are making with 3 different values.

Record the players time in mili-seconds, and save that as a value in the player.
The timer will simply be math, so divide mili-seconds into seconds, then seconds into minutes. That way, you can just do

``````If Time.Value >= goldtime then
``````

And have elseif’s for other rewards

1 Like

Alright, I will do that, thank you so much!

1 Like