Paste #1692: Countdown Timer

Date: 2014/02/04 00:25:31 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


TestCountdown:
  type: task
  definitions: seconds
  script:
  - define countdown 1.0
  - define diff "<m:1.0/%seconds%>"
  - adjust <player> "fake_experience:%countdown%"
  - repeat <def[seconds].as_int> {
    - define countdown <def[countdown].sub[%diff%]>
    - run s@CountdownWaitTask "delay:%value%s" "def:%countdown%"
    }

CountdownWaitTask:
  type: task
  definitions: countdown
  script:
  - adjust <player> "fake_experience:%countdown%"