Date: 2014/05/25 08:35:51 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# Minecart disposal
#
MinecartTrash:
type: world
debug: true
# Local script for handling cart removal
# (So we don't have a bunch of duplicated scripting)
cart_remover:
- flag <player> no_exit duration:1s
- remove <context.vehicle>
- queue clear
events:
#
# Handle minecart collisions with cactus
#
on minecart collides with cactus:
# Make sure there's a passenger
- if <context.vehicle.get_passenger> == null inject locally cart_remover
# Check regions, do stuff
- if <context.vehicle.location.in_region[prisona]> {
- execute as_server "manuadd <context.vehicle.get_passenger.name> A Prison"
- run rankA as:<context.vehicle.get_passenger>
} else if <context.vehicle.location.in_region[prisonh]> {
- execute as_server "manuadd <context.vehicle.get_passenger.name> H Prison"
- run rankH as:<context.vehicle.get_passenger>
}
# No matter what at this point, remove the cart
- inject locally cart_remover
#
# Handle minecart exit for players
#
on player exits minecart:
# If collision with cactus just happened, no need to continue
- if <player.is_flagged[no_exit]> queue clear
- if <context.vehicle.location.in_region[prison|starttoa]> {
- execute as_player "warp prison"
} else if <context.vehicle.location.in_region[prisona]> {
- execute as_server "manuadd <context.vehicle.get_passenger.name> A Prison"
- execute as_player "warp a"
} else if <context.vehicle.location.in_region[gtoh]> {
- execute as_player "warp gtoh"
}
# Remove the cart
- inject locally cart_remover
"rankA":
type: task
debug: true
script:
- execute as_player "warp a"
"rankH":
type: task
debug: true
script:
- execute as_player "warp h"