-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSkript Economy
177 lines (132 loc) · 7.82 KB
/
Skript Economy
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#############################################################################################################################################################################################################################################################################
#############################################################################################################################################################################################################################################################################
#############################################################################################################################################################################################################################################################################
#############################################################################################################################################################################################################################################################################
MADE BY HMR_ABOOD
18.7.2024
#############################################################################################################################################################################################################################################################################
#############################################################################################################################################################################################################################################################################
#############################################################################################################################################################################################################################################################################
#############################################################################################################################################################################################################################################################################
every second:
loop all players:
set loop-player's balance to {coin::%loop-player's uuid%}
command /coins [<offline player>]:
trigger:
if arg-1 is not set:
send "&aYou Currently have &6%formatNumber({coin::%player's uuid%})%⛁" to player
else if arg-1 is set:
send "&a%arg-1% Currently has &6%formatNumber({coin::%arg-1's uuid%})%⛁"
command /pay [<offline player>] [<integer>]:
trigger:
if arg-1 is not set:
send "Correct usage of this command is &a/pay <player> <amount> " to player
if arg-2 is set:
if {coin::%player's uuid%} is greater than arg-2:
if arg-2 is greater than 0:
send "&aYou have given %arg-1% &6%formatNumber(arg-2)%⛁ ᴄᴏɪɴꜱ" to player
set {payer} to player
send "&aYou just recived &6%formatNumber(arg-2)%⛁ ᴄᴏɪɴꜱ &afrom %{payer}%" to arg-1
remove arg-2 from {coin::%player's uuid%}
add arg-2 to {coin::%arg-1's uuid%}
else if {coin::%player's uuid%} is less than arg-2:
send "&cPayment Failed! You dont have the right amount of coins." to player
if arg-2 is less than 1:
send "&cPayment Failed, You cant pay less than 1 coin!"
command /bal:
trigger:
make player execute "/coin"
command /money:
trigger:
make player execute "/coin"
command /coin [<text>] [<offlineplayer>] [<integer>]:
trigger:
if arg-1 is not set:
if player does not have permission "coin.admin":
send "&a------------------------------------" to player
send "&e &l ⛁Coins⛁" to player
send "&6&l INFO:" to player
send "&e&lCommands:" to player
send "&a- &6/Coins - Shows you how much coins you have" to player
send "&a- &6/Pay <player> <amount> - Makes you give a player coins from your balance" to player
send "&a------------------------------------" to player
else if player has permission "coin.admin":
send "&a------------------------------------" to player
send "&e &l ⛁Coins⛁" to player
send "&6&l INFO:" to player
send "&e&lCommands:" to player
send "&a- &6/Coins - Shows you how much coins you have" to player
send "&a- &6/Pay - Makes you give a player coins from your balance" to player
send "&c Admin Command -&6 /Coin wipe <player> - Wipes the player's balance" to player
send "&c Admin Command -&6 /Coin give <player> <amount> - Gives the player coins " to player
send "&c Admin Command -&6 /Coin remove <player> <amount> - Removes the specified amount of coins" to player
send "&cAdmin Command -&6 /Coin set <player> <amount> - Sets the player's coins to the set amount" to player
if arg-1 is "wipe":
if player has permission "coin.admin":
set {coin::%arg-2's uuid%} to 0
set {_staff} to player
send "&aYou have successfully wiped %arg-2%'s balance" to player
send "&c&l[WIPED] &cYou have been wiped by %{_staff}%" to arg-2
if arg-1 is "give":
if player has permission "coin.admin":
add arg-3 to {coin::%arg-2's uuid%}
set {staff} to player
send "&aYou have successfully Given %arg-2% &6%formatNumber(arg-3)%⛁ ᴄᴏɪɴꜱ" to player
send "&aYou have been given &6%formatNumber(arg-3)%⛁ ᴄᴏɪɴꜱ &aBy %{staff}% " to arg-2
if arg-1 is "set":
if player has permission "coin.admin":
set {coin::%arg-2's uuid%} to arg-3
send "&aYou have successfully set %arg-2% ᴄᴏɪɴꜱ to &6%formatNumber(arg-3)%⛁ " to player
send "&aYour coins have been set to &6%formatNumber(arg-3)%⛁ ᴄᴏɪɴꜱ &aBy %{staff}% " to arg-2
if arg-1 is "remove":
if player has permission "coin.admin":
remove arg-3 from {coin::%arg-2's uuid%}
send "&aYou have successfully removed &6%formatNumber(arg-3)%⛁ ᴄᴏɪɴꜱ from %arg-2%" to player
send "&a%{staff}% removed &6%formatNumber(arg-3)%⛁ ᴄᴏɪɴꜱ &afrom your balance " to arg-2
if arg-1 is set:
if player does not have permission "coin.admin":
send "&cThis command is restricted" to player
command /eese:
permission: op
trigger:
add 0.5 to {multiplier::%player's uuid%}
options:
name: &7[&eSlow&6Farms&7]
command /seell:
trigger:
sell(player, (inventory of player))
function sell(p: player, c: inventory):
set {_total} to "0" parsed as an integer
loop all items in {_c}:
set {_i} to 1 of loop-item
if {worth::%{_i}%} is set:
set {_amount} to item amount of loop-item
add {_amount} * {worth::%{_i}%} * {multiplier::%{_p}'s uuid%} to {_total}
remove loop-item from {_c}
add {_amount} to {_sold}
if {_total} > 0:
if {sell::toggle::%{_p}%} is true:
send "{@name} &7You have sold &e%{_sold}% &7Items for &6$%{_total}%" to {_p}
add {_total} to {coin::%{_p}'s uuid%}
if {sound::sell::%{_p}%} is true:
play sound "entity.villager.celebrate" with volume 100 and pitch 0.5 at {_p} for {_p}
else:
send "{@name} &cYou dont have any items to sell." to {_p}
if {sound::sell::%{_p}%} is true:
play sound "entity.villager.no" with volume 100 and pitch 0.32 at {_p} for {_p}
function formatNumber(n: number) :: text:
if {_n} < 1000:
return "%{_n}%"
set {_data} to "QT,18|Q,15|T,12|B,9|M,6|k,3"
loop split {_data} at "|":
set {_s::*} to split loop-value at ","
{_n} >= 10 ^ {_s::2} parsed as number
return "%{_n} / 10 ^ {_s::2} parsed as number%%{_s::1}%"
return "%{_n}%"
on join:
if {coin::%player's uuid%} is not set:
set {coin::%player's uuid%} to 0
every 1 second:
loop all players:
if {coin::%loop-player's uuid%} is less than 0:
set {coin::%loop-player's uuid%} to 0