- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleEssentials Elements
TypeDenizen Script
Date2017/12/12 13:50:58 UTC-08:00
ByGuest
Other
Paste
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
44100
World:
  type: world
  debug: false
  events:
    on player chats:
    - if <player.has_flag[afk]> {
      - flag player afk:!
      }
    - define list li@
    - define player <player>
    - foreach <server.list_online_players>:
      - if <yaml[<def[value]>].list_keys[Factions.miscellaneous.ignorelist].contains[<def[player]>]> {
        - define list <def[list].include[<def[value]>]>
        }
    - determine recipients:<server.list_online_players.exclude[<def[list]>]>
    on player walks:
    - if !<player.has_flag[warping]> {
      - queue clear
      }
    - if <player.flag[warping].get_sub_items[2].get[1].as_location.x.sub[<context.new_location.x>].abs.is[OR_MORE].to[0.4]> || <player.flag[warping].get_sub_items[2].get[1].as_location.y.sub[<context.new_location.y>].abs.is[OR_MORE].to[0.4]> || <player.flag[warping].get_sub_items[2].get[1].as_location.z.sub[<context.new_location.z>].abs.is[OR_MORE].to[0.4]> {
      - narrate "<&c>Teleport cancelled..."
      - flag player warping:!
      }
    on player join:
    - if !<player.is_op> {
      - announce "<&7>[<&a>+<&7>] <&b><&l><player.name><&r><&e> has joined the game."
      }
      else {
      - narrate "<&7>[<&a>+<&7>] <&4><&l><player.name><&r><&e> has joined the game." targets:<server.list_ops>
      }
    - run s@PlayPoints d:<player> instantly
    on player quit:
    - if !<player.is_op> {
      - announce "<&7>[<&c>-<&7>] <&b><&l><player.name><&r><&e> has left the game."
      }
    - flag player afk:!
EcoCommand:
  type: command
  name: eco
  usage: /eco (give|take|set) (player) (amount)
  description: Adjusts player balances
  script:
  - if !<player.is_op> {
    - queue clear
    }
  - choose <context.args.size>:
    - case 3:
      - if <server.match_player[<context.args.get[2]>]> == null {
        - narrate "<&c>That player eithe does not exist or is not online."
        - queue clear
        }
      - if !<context.args.get[3].is[matches].to[number]> {
        - narrate "<&c>That is not a valid amount."
        - queue clear
        }
      - choose <context.args.get[1]>:
        - case give:
          - money give quantity:<context.args.get[3]> players:<server.match_player[<context.args.get[2]>]>
          - narrate "<&a>$<context.args.get[3]> <&b>has been added to <context.args.get[2].to_titlecase><&sq>s account." targets:<player>
          - narrate "<&a>$<context.args.get[3]> <&b>has been added to your account." targets:<server.match_player[<context.args.get[2]>]>
        - case take:
          - money take quantity:<context.args.get[3]> players:<server.match_player[<context.args.get[2]>]>
          - narrate "<&a>$<context.args.get[3]> <&b>has been taken to <context.args.get[2].to_titlecase><&sq>s account." targets:<player>
          - narrate "<&a>$<context.args.get[3]> <&b>has been taken to your account." targets:<server.match_player[<context.args.get[2]>]>
        - case set:
          - money set quantity:<context.args.get[3]> players:<server.match_player[<context.args.get[2]>]>
          - narrate "<&b><context.args.get[2].to_titlecase><&sq>s balance has been set to <&a>$<context.args.get[3]><&b>." targets:<player>
          - narrate "<&b>Your balance has been set to <&a>$<context.args.get[3]><&b>." targets:<server.match_player[<context.args.get[2]>]>
    - default:
      - narrate "<&c>Usage /eco (give|take|set) (player) (amount)"
PayCommand:
  type: command
  name: pay
  usage: /pay (player) (amount)
  description: Pay money to another player
  script:
  - choose <context.args.size>:
    - case 2:
      - if <server.match_player[<context.args.get[1]>]> == null || <context.args.get[1].contains[<player.name>]> {
        - narrate "<&c>That player either does not exist or is not online."
        - queue clear
        }
      - if !<context.args.get[2].is[matches].to[number]> {
        - narrate "<&c>That is not a valid amount."
        - queue clear
        }
      - if <player.money.is[LESS].than[<context.args.get[2]>]> {
        - narrate "<&c>You do not have enough money."
        - queue clear
        }
      - money take quantity:<contet.args.get[2]> players:<player>
      - money give quantity:<contet.args.get[2]> players:<server.match_player[<context.args.get[1]>]>
      - narrate "<&b>You paid <&a>$<context.args.get[3]> <&b>to <&a><server.match_player[<context.args.get[1]>]>." targets:<player>
      - narrate "<&b><player.name> has paid you <&a>$<context.args.get[3]> <&b>." targets:<server.match_player[<context.args.get[1]>]>
    - default:
      - narrate "<&c>Usage /pay (player) (amount)"
BalCommand:
  type: command
  name: bal
  usage: /bal
  description: Checks your current balances
  aliases:
  - balance
  - money
  - currency
  script:
  - narrate "<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=" 
  - narrate "<&b>Balance<&7><&co> <&e>$<player.money.format_number>"
  - narrate "<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>="
BaltopCommand:
  type: command
  debug: false
  name: baltop
  usage: /baltop (page#)
  description: Checks the top balances on the server.
  speed: 0
  script:
  - if <player.has_flag[baltop]> {
    - narrate "<&c>Please do not spam this command."
    - queue clear
    }
  - narrate "<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=<&2>=<&6>=" 
  - if <context.args.size.is[OR_MORE].than[1]> && <context.args.get[1]> matches number {
    - define page <context.args.get[1]>
    }
    else {
    - define page 1
    - narrate "<&6>Ordering balances for <&a><server.list_players.size> <&6>players..."
    }
  - define li <server.list_players.filter[money.is[MORE].than[0]].sort_by_number[money].reverse>
  - define mod <el@10.mul[<def[page].sub[1]>]>
  - repeat 10:
    - if <def[li].get[<def[value].add[<def[mod]>]||null> == null {
      - narrate "<&e>---- Page <&6><def[page]> <&e>of <&6><def[page]> <&e>----"
      - queue clear
      }
    - narrate "  <&6><def[value].add[<def[mod]>].as_int><&f><def[li].get[<def[value].add[<def[mod]>]>].name> <&7><&a>$<&e><def[li].get[<def[value].add[<def[mod]>]>].money.as_money>"
  - narrate "<&e>---- Page <&6><def[page]> <&e>of <&6><def[li].size.div[10].round_up> <&e>----"
  - flag <player> baltop duration:3s
MsgCommand:
  type: command
  name: message
  usage: /msg (player) (message)
  description: Send a message to a player
  aliases:
  - m
  - msg
  script:
  - if <context.args.size.is[OR_LESS].than[1]>  {
    - narrate "<&c>Usage: /msg (player) (message)"
    - queue clear
    }
  - define type chat
  - inject s@LawEnforcement instantly
  - define sender <player>
  - define target <server.match_player[<context.args.get[1]||null>]>
  - flag <def[sender]> messaged:<def[target]>
  - flag <def[target]> messaged:<def[sender]>
  - if <def[target].is[==].to[<def[sender]>]> {
    - narrate "<&c>You can<&sq>t message yourself..."
    - queue clear
    }
  - if <server.list_online_players.filter[contains[<def[target]>]].is_empty> {
    - narrate "<&c>Please specify an online player."
    - queue clear
    }
  - narrate "<&b><def[sender].name> <&7>-<&gt> <&b>You<&7><&co> <context.args.remove[1].space_separated>" targets:<def[target]>
  - narrate "<&b>You <&7>-<&gt> <&b><def[target].name><&7><&co> <context.args.remove[1].space_separated>" targets:<def[sender]>
  
ReplyCommand:
  type: command
  name: reply
  usage: /reply
  description: Reply to a message
  aliases:
  - r
  - reply
  script:
  - if !<player.has_flag[messaged]> {
    - narrate "<&c>No one has messaged you since you last logged in."
    - queue clear
    }
  - narrate "<&b><player.name> <&7>-<&gt> <&b>You<&7><&co> <context.args.space_separated>" targets:<player.flag[messaged].as_player>
  - narrate "<&b>You <&7>-<&gt> <&b><player.flag[messaged].as_player.name><&7><&co> <context.args.space_separated>" targets:<player>          

IgnoreCommand:
  type: command
  debug: false
  name: ignore
  usage: /ignore (player)
  description: Ignores all messages from the designated player.
  aliases:
  - begonethot
  - shutup
  script:
  - if <context.args.as_list.size> == 0 {
    - narrate "<&c>Usage /ignore (player)"
    - queue clear
    }
  - define target <context.args.get[1]>
  - if <server.match_offline_player[<def[target]>]> == null || <def[target]> == <player.name> {
    - narrate "<&c>That player is offline or is an invalid option."
    - queue clear
    }
  - if <yaml[<player>].contains[Factions.miscellaneous.ignorelist]> && <yaml[<player>].list_keys[Factions.miscellaneous.ignorelist].contains[<def[target].as_player>]> {
    - yaml set id:<player> Factions.miscellaneous.ignorelist:<-:<def[target].as_player>
    - narrate "<&b><def[target]> is no longer being ignored." targets:<player>
    - narrate "<&a><player.name> is no longer ignoring you." targets:<def[target]>
    }
    else {
    - yaml set id:<player> Factions.miscellaneous.ignorelist:->:<def[target].as_player>
    - narrate "<&c><def[target]> is now being ignored." targets:<player>
    - narrate "<&c><player.name> is now ignoring you." targets:<def[target]>    
    }
TPAllCommand:
  type: command
  debug: true
  name: tpall
  usage: /tpall (flagname)
  description: Teleports all players to your location (optionally specify a player flag to sort by)
  script:
  - if !<player.is_op> {
    - narrate "<&c>You do not have permission to use this command"
    - queue clear
    }
  - if <context.args.as_list.size> == 0 {
    - teleport <server.list_online_players> <player.location>
    - narrate "<&6>You have been teleported by a staff member." targets:<server.list_online_players>
    - queue clear
    }
  - define flag <context.args.get[1]>
  - foreach <server.list_online_players.filter[has_flag[<def[flag]>]]> {
    - teleport <def[value]> <player.location>
    - narrate "<&6>You have been teleported by a staff member." targets:<def[value]>
    }
TPAHereCommand:
  type: command
  debug: true  
  name: tpahere
  usage: /tpahere (player)
  description: Request to teleport a player to your location.
  script:
  - if <context.args.as_list.size> == 0 {
    - narrate "<&c>Usage /tpahere (player)"
    - queue clear
    }
  - define target <context.args.get[1]>
  - if <server.match_player[<def[target]>]> == null || <def[target]> == <player.name> {
    - narrate "<&c>That player is offline or is an invalid option."
    - queue clear
    }
  - if <player.flag[tpahere].as_list.contains[<def[target].as_player>]||null> {
    - narrate "<&c>You are already teleporting to that player."
    - queue clear
    }
  - if <player.flag[tpa].as_list.contains[<def[target].as_player>]||null> {
    - flag <player> tpa:<-:<def[target].as_player>
    - flag <def[target].as_player> tpaccept:<-:<player>
    - narrate "<&b>Overriding previous tpa request to this player."
    }
  - flag <player> tpahere:->:<context.args.get[1].as_player> duration:<s@config.yaml_key[tpacceptduration]>s
  - flag <context.args.get[1].as_player> tpaccept:->:<player> duration:<s@config.yaml_key[tpacceptduration]>s
  - narrate "<&6>Request sent to <&c><context.args.get[1]><&6>." targets:<player>
  - narrate "<&c><player.name> <&6>has requested that you teleport to them.<&nl><&6>To accept this request, type <&c>/tpaccept (name)<&6>.<&nl><&6>To deny this request, type <&c>/tpdeny (name)<&6>.<&nl><&6>This reqeust will timeout after <&c><s@config.yaml_key[tpacceptduration]> seconds<&6>." targets:<context.args.get[1].as_player>
TPACommand:
  type: command
  debug: true  
  name: tpa
  usage: /tpa (player)
  description: Request to teleport to a player.
  script:
  - if <context.args.as_list.size> == 0 {
    - narrate "<&c>Usage /tpa (player)"
    - queue clear
    }
  - define target <context.args.get[1]>
  - if <server.match_player[<def[target]>]> == null || <def[target]> == <player.name> {
    - narrate "<&c>That player is offline or is an invalid option."
    - queue clear
    }
  - if <player.flag[tpa].as_list.contains[<def[target].as_player>]||null> {
    - narrate "<&c>You are already teleporting to that player."
    - queue clear
    }
  - if <player.flag[tpahere].as_list.contains[<def[target].as_player>]||null> {
    - flag <player> tpahere:<-:<def[target].as_player>
    - flag <def[target].as_player> tpaccept:<-:<player>
    - narrate "<&b>Overriding previous tpahere request from this player."
    }
  - flag <player> tpa:->:<context.args.get[1].as_player> duration:<s@config.yaml_key[tpacceptduration]>s
  - flag <context.args.get[1].as_player> tpaccept:->:<player> duration:<s@config.yaml_key[tpacceptduration]>s
  - narrate "<&6>Request sent to <&c><context.args.get[1]><&6>." targets:<player>
  - narrate "<&c><player.name> <&6>has requested to teleport to you.<&nl><&6>To accept this request, type <&c>/tpaccept (name)<&6>.<&nl><&6>To deny this request, type <&c>/tpdeny (name)<&6>.<&nl><&6>This reqeust will timeout after <&c><s@config.yaml_key[tpacceptduration]> seconds<&6>." targets:<context.args.get[1].as_player>
TPAcceptCommand:
  type: command
  debug: true  
  name: tpaccept
  usage: /tpaccept (player)
  description: Request to teleport to a player.
  script:
  - if <context.args.as_list.size> == 0 {
    - narrate "<&c>Usage /tpaccept (player)"
    - queue clear
    }
  - define target <context.args.get[1]>
  - if <server.match_player[<def[target]>]> == null || !<player.flag[tpaccept].as_list.contains[<def[target].as_player>]||null> {
    - narrate "<&c>That player is offline or is an invalid option."
    - queue clear
    }
  - narrate "<&6>Teleport request accepted." targets:<player>|<def[target].as_player>
  - flag <player> tpaccept:<-:<def[target].as_player>
  - if <def[target].as_player.flag[tpa].contains[<player>]||null> {
    - flag <context.args.get[1].as_player> tpa:<-:<player>
    - run s@TeleportCheck d:<context.args.get[1].as_player>|<player>|player|<player.location> instantly
    }
    else {
    - flag <context.args.get[1].as_player> tpahere:<-:<player>
    - run s@TeleportCheck d:<player>|<context.args.get[1].as_player>|player|<def[target].as_player.location> instantly
    }
TPDenyCommand:
  type: command
  debug: true  
  name: tpdeny
  usage: /tpdeny (player)
  description: Denies a teleport request from a player.
  script:
  - if <context.args.as_list.size> == 0 {
    - narrate "<&c>Usage /tpdeny (player)"
    - queue clear
    }
  - define target <context.args.get[1]>
  - if <server.match_player[<def[target]>]> == null || !<player.flag[tpaccept].as_list.contains[<def[target].as_player>]||null> {
    - narrate "<&c>That player is offline or is an invalid option."
    - queue clear
    }
  - narrate "<&6>Teleport request denied." targets:<player>|<def[target].as_player>
  - flag <player> tpaccept:<-:<def[target].as_player>
  - flag <context.args.get[1].as_player> tpa:<-:<player>
  - flag <context.args.get[1].as_player> tpahere:<-:<player>
WarpsCommand:
  type: command
  debug: true  
  name: warps
  usage: /warps
  description: Lists available warps
  script:
  - define list li@
  - foreach <s@config.list_keys[commandwarps]>:
    - define list li@<def[list].include[<def[value]>].separated_by[,<&sp>]>
  - narrate "<&6>Warps<&co> <parse:<def[list].replace_text[li@]>>"
WarpCommand:
  type: command
  debug: true  
  name: warp
  usage: /warp (warpname)
  description: Warps to a specified valid warp.
  script:
  - if <context.args.size> == 0 {
    - narrate "<&c>Usage<&co> /warp (warpname)"
    - queue clear
    }
  - if <player.has_flag[warping]> {
    - narrate "<&c>Already teleporting..."
    - queue clear
    }
  - if <s@config.list_keys[commandwarps].contains[<context.args.get[1]>]> {
    - run s@TeleportCheck d:<player>|<context.args.get[1]>|warp instantly
    }
HomesCommand:
  type: command
  debug: true  
  name: homes
  usage: /homes
  description: Lists all of your set homes.
  script:
  - define list li@
  - foreach <yaml[<player>].list_keys[Factions.homes]||null>:
    - define list li@<def[list].include[<def[value]>].separated_by[,<&sp>]>
  - narrate "<&6>Homes<&co> <parse:<def[list].replace_text[li@]||&sp>>"
HomeCommand:
  type: command
  debug: true  
  name: home
  usage: /home (homename)
  description: Warps to one of your set homes.
  script:
  - if <context.args.as_list.size> == 0 {
    - narrate "<&c>Usage<&co> /home (homename)"
    - queue clear
    }
  - if <player.has_flag[warping]> {
    - narrate "<&c>Already teleporting..."
    - queue clear
    }
  - if <yaml[<player>].list_keys[Factions.homes].is_empty||true> || !<yaml[<player>].list_keys[Factions.homes].contains[<context.args.get[1]>]> {
    - narrate "<&c>You do not have a home with that name."
    - queue clear
    }
  - run s@TeleportCheck d:<player>|<context.args.get[1]>|home instantly
SetHomeCommand:
  type: command
  debug: true  
  name: sethome
  usage: /sethome (homename)
  description: Sets a home at your current location.
  script:
  - if <context.args.size]> == 0 {
    - narrate "<&c>Usage<&co> /sethome (homename)"
    - queue clear
    }
  - if <yaml[<player>].list_keys[Factions.homes].contains[<context.args.get[1]>]||null> {
    - narrate "<&c>You already have a home with that name."
    - queue clear
    }
  - yaml set id:<player> Factions.homes.<context.args.get[1].to_lowercase>:<player.location>
  - narrate "<&b>Home <&dq><context.args.get[1]><&dq> has been set!"
SpawnCommand:
  type: command
  debug: true  
  name: spawn
  usage: /spawn
  description: Warps to spawn
  script:
  - if <player.has_flag[warping]> {
    - narrate "<&c>Already teleporting..."
    - queue clear
    }
  - run s@TeleportCheck d:<player>|spawn|warp instantly
ShopCommand:
  type: command
  debug: true
  name: shop
  usage: /shop
  description: Warps to the Shop
  script:
  - if <player.has_flag[warping]> {
    - narrate "<&c>Already teleporting..."
    - queue clear
    }
  - run s@TeleportCheck d:<player>|shop|warp instantly



RawRaw



Pastes made: 62778