-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoints_shop.sk
94 lines (82 loc) · 4.48 KB
/
points_shop.sk
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
on load:
set {ChatColor1GuiItem} to red dye of mending with lore "&e&lChat Color" with all flags hidden
set {ChatColor2GuiItem} to green dye of mending with lore "<##ff9736>&lChat Color" with all flags hidden
set {ChatColor3GuiItem} to blue dye of mending with lore "&a&lChat Color" with all flags hidden
set {ChatColor4GuiItem} to pink dye of mending with lore "<##f9500a>&lChat Color" with all flags hidden
set {ChatColor5GuiItem} to white dye of mending with lore "<##f65874>&lChat Color" with all flags hidden
function tokenShop(p: player):
set {_gui} to a new chest inventory with 5 row with name "&e&lTokens Shop:"
set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43 and 44 of {_gui} to black stained glass pane named " "
set slot 11 of {_gui} to {ChatColor1GuiItem}
set slot 12 of {_gui} to {ChatColor2GuiItem}
set slot 13 of {_gui} to {ChatColor3GuiItem}
set slot 14 of {_gui} to {ChatColor4GuiItem}
set slot 15 of {_gui} to {ChatColor5GuiItem}
if {Tokens::%uuid of {_p}%} is higher than or equal to 1:
set slot 31 of {_gui} to gold block of mending named "&7Balance: &f%{Tokens::%uuid of {_p}%}%" with all flags hidden
else:
set slot 31 of {_gui} to gold block of mending named "&7Balance: &f0" with all flags hidden
open {_gui} to {_p}
on inventory click:
if name of event-inventory is "&e&lTokens Shop:":
cancel event
if event-slot is 11:
if {Tokens::%uuid of player%} is higher than or equal to 2:
play sound "block.grindstone.use" with volume 0.5 to the player
subtract 2 from {Tokens::%uuid of player%}
if event-slot is 12:
if {Tokens::%uuid of player%} is higher than or equal to 2:
play sound "block.grindstone.use" with volume 0.5 to the player
subtract 2 from {Tokens::%uuid of player%}
if event-slot is 13:
if {Tokens::%uuid of player%} is higher than or equal to 2:
play sound "block.grindstone.use" with volume 0.5 to the player
subtract 2 from {Tokens::%uuid of player%}
if event-slot is 14:
if {Tokens::%uuid of player%} is higher than or equal to 2:
play sound "block.grindstone.use" with volume 0.5 to the player
subtract 2 from {Tokens::%uuid of player%}
if event-slot is 15:
if {Tokens::%uuid of player%}} is higher than or equal to 2:
play sound "block.grindstone.use" with volume 0.5 to the player
subtract 2 from {Tokens::%uuid of player%}
on tab complete of "/set-player-tokens":
set tab completions for position 1 to 1, 100, 1000, 10000
on tab complete of "/give-player-tokens":
set tab completions for position 1 to 1, 100, 1000, 10000
command /test-tokens-gui:
permission: op
permission message: &4Stop! &cYou cant use this command!
trigger:
tokenShop(player)
command /give-player-tokens <player> <number>:
permission: op
permission message: &4Stop! &cYou can't use this command!
trigger:
if arg-1 not set:
send "Incorrect usage: /give-player-tokens <player> <amount>" to player
else if arg-2 not set:
send "Incorrect usage: /give-player-tokens <player> <amount>" to player
else:
add arg-2 to {Tokens::%uuid of arg-1%}
send "&7Gave %{arg-1}% %{arg-2}% Tokens!" to player
command /set-player-tokens <player> <number>:
permission: op
permission message: &4Stop! &cYou can't use this command!
trigger:
if arg-1 not set:
send "Incorrect usage: /set-player-tokens <player> <amount>" to player
else if arg-2 not set:
send "Incorrect usage: /set-player-tokens <player> <amount>" to player
else:
set {Tokens::%uuid of arg-1%} to arg-2
send "&7Set %{arg-1}%'s Tokens to %{arg-2}%!" to player
command /reset-player-tokens <player>:
permission: op
permission message: &4Stop! &cYou can't use this command!
trigger:
if arg-1 not set:
send "Incorrect usage: /restet-player-Tokens <player>" to player
else:
set {Tokens::%uuid of arg-1%} to 0
send "&7Set %{arg-1}%'s Tokens to 0!" to player