Date: 2014/07/28 16:50:54 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
PlayerHealthBar:
type: world
events:
on player join:
- flag player healthbar
- run determinehealth
on player quits:
- flag healthbar:!
entity damaged:
- run healplayer
determinehealth:
type: task
script:
- if <player.has_flag[healthbar]> {
- define currenthealth <player.health>
- define %totalhealth% 20
- if <player.equipment.helmet.lore> contains health {
- define %currenthealth% <%currenthealth%.add[health +]>
- define %totalhealth% <%totalhealth%.add[health +]>
- adjust <player> show_boss_bar:%currenthealth%/%totalhealth%
- run determinehealth
}
- if <player.equipment.chestplate.lore> contains health {
- define %currenthealth% <%currenthealth%.add[health +]>
- define %totalhealth% <%totalhealth%.add[health +]>
- adjust <player> show_boss_bar:%currenthealth%/%totalhealth%
- run determinehealth
}
- if <player.equipment.leggings.lore> contains health {
- define %currenthealth% <%currenthealth%.add[health +]>
- define %totalhealth% <%totalhealth%.add[health +]>
- adjust <player> show_boss_bar:%currenthealth%/%totalhealth%
- run determinehealth
}
- if <player.equipment.shoes.lore> contains health {
- define %currenthealth% <%currenthealth%.add[health +]>
- define %totalhealth% <%totalhealth%.add[health +]>
- adjust <player> show_boss_bar:%currenthealth%/%totalhealth%
- run determinehealth
}
} else {
- announce "<player.name> has logged off"
healplayer:
type: task
script:
- health <player> 20