Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to add time to your Scratch Projects
- SpringTrapDX
-
Scratcher
2 posts
How to add time to your Scratch Projects
h
Last edited by SpringTrapDX (July 20, 2015 08:17:57)
- Thejbomber
-
Scratcher
100+ posts
How to add time to your Scratch Projects
1. This section is where you ask how to do things.
2. That's not a block.
3. To get time, you click the check box next to the current minute block.
2. That's not a block.
3. To get time, you click the check box next to the current minute block.
- applesauceepicness
-
Scratcher
500+ posts
How to add time to your Scratch Projects
You could also use the timer and just use this script:
when green flag clicked
reset timer
Well you should just make sure that you add either show timer/hide timer
Last edited by applesauceepicness (July 20, 2015 14:22:54)
- Creator1972
-
Scratcher
26 posts
How to add time to your Scratch Projects
It's pretty simple.
You see, we have this block:
And this:
We can make a variable that stores this, using this script:
Just make the second timer be the blue block (timer) that I showed earlier. We also have:
Insert timer in that space again.
Hope I helped!
Creator1972
You see, we have this block:
(timer)
And this:
reset timer
We can make a variable that stores this, using this script:
when green flag clicked
set [ Timer] to [(timer) ]
Just make the second timer be the blue block (timer) that I showed earlier. We also have:
when [ v] > (10)
Insert timer in that space again.
Hope I helped!

Creator1972
- Thejbomber
-
Scratcher
100+ posts
How to add time to your Scratch Projects
Guys I think they meant time as in 12:00, not a stopwatch.
If you want actual time, use this.
If you want actual time, use this.
when green flag clicked
forever
set [Minutes v] to [ (current [minute v])
if <(current [hour v]) < [13 ]> then
set [hour v] to [(current [hour v]) ]
end
if <not <(current [hour v]) < [13 ]>> then
set [hour v] to [((current [hour v]) - (12)) ]
end
end
- Thejbomber
-
Scratcher
100+ posts
How to add time to your Scratch Projects
So apparently scratchblocks doesn't like operators. So for the “if not” block, use this instead.
((hours) - (12))And for some reason the variables section comes out red.
set [hours v] to [ ]
- juicykiwi-
-
Scratcher
10 posts
How to add time to your Scratch Projects
So there is a time block that reports any unit of time you want. To get the current time, join these blocks:
However, that will only give you the military time. To fix this, you need to use a mod block in the hour spot, saying
which will always give you a number less than 12. For instance, if the time is 5:30 PM, then it will normally read 17:30. This block will change it to 5:30. The mod block finds the remainder of a division problem.
(join (current [hour v]) (join [:] (current [minute v])))
However, that will only give you the military time. To fix this, you need to use a mod block in the hour spot, saying
((current [hour v]) mod (12))
which will always give you a number less than 12. For instance, if the time is 5:30 PM, then it will normally read 17:30. This block will change it to 5:30. The mod block finds the remainder of a division problem.
- TheGirlThatLovesToc
-
Scratcher
4 posts
How to add time to your Scratch Projects
scratchblocks]
say for (2) secs
say for (2) secs
- Vibrato
-
Scratcher
1000+ posts
How to add time to your Scratch Projects
scratchblocks]please don't necropost
say for (2) secs
- Discussion Forums
- » Help with Scripts
-
» How to add time to your Scratch Projects