#how to make countdown?

1 messages · Page 1 of 1 (latest)

tired bluff
#

the speed is the same as real time

small mulch
#

Date.now()

#

And use system.runSchedule

#

To keep it running

mellow minnow
#
let n = 10, ref = system.runSchedule(() => {
  if (n-- == 0)
    system.clearRunSchedule( ref );

    // code

})
small mulch
mellow minnow
#

just use tick for counter

#

more than enough

#

Date.now() is um needed and pointless

empty jungle
#

I'm wondering, what happens when an run schedule is cleared more times?

#

Would that cause any issues?

mellow minnow
#

script runs every 0.05 sec

#

20 times in 1 sec 1/20 = 0.05

tired bluff
#

Alg tq

mellow minnow
#

thats enough speed for count down imo

empty jungle
#

I'm just curious

mellow minnow
#

it might give error

empty jungle
#

But not an fatal one right?

#

It will just say something like run schedule don't exist

#

(I hope)

mellow minnow
#

ye

empty jungle
#

Ah, nice

#

I guess theres also no way to detect if an special run schedule is running rn

green onyx
empty jungle
dawn oriole
empty jungle
dawn oriole
high flame
dawn oriole
#

Aha, thanks!

dawn oriole
small mulch
#

/MCBE Addon Creator

mellow minnow
#

?

slate trench
#

i made this a while ago it works pretty good