Date: 2020/10/12 10:50:47 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
#############################
# Inventory
#############################
portier_iron_Inventory:
type: inventory
title: "<&7>Iron Tier Menu"
size: 18
slots:
- "[i@room_iron] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] [i@a_back]"
############################
# Rooms
############################
room_iron:
type: item
material: "iron_ingot"
display name: "<&3>Room iron"
lore:
- "Extras: none"
############################
# Keys
############################
room_iron_key:
type: item
material: "paper"
display name: "<&7>Room iron"
lore:
- "Key for room iron"
############################
# Handlers
############################
portier_iron_Inventory_Handler:
type: world
events:
on player clicks in portier_iron_Inventory:
- determine cancelled
on player drags in portier_iron_Inventory:
- determine cancelled
on player clicks room_iron in portier_iron_Inventory:
- if <player.money> >= 10 {
- if <server.has_flag[room_iron]> == false {
- flag player have_room:true
- flag server room_iron:true
- inventory close
- give room_iron_key
- narrate "You paid <&a>$<&e>10<&f> for room iron"
- take money quantity:10
} else {
- narrate 'Room occupied'
}
} else {
- narrate "<&c>You don't have enough money"
}
on player clicks a_back in portier_iron_Inventory:
- inventory open d:in@portier_main_Inventory
on player clicks dark_oak_door in room_iron:
- wait 0.001
- if <player.inventory.contains[i@room_iron_key]> != true {
- narrate "<&c>You don't have the key for this room!"
- switch <context.location> state:off
}