Paste #44546: Untitled Paste

Date: 2017/09/19 23:14:03 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


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
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939


## Cake?

Plot_Config_Events:
    type: world
    events:
        on player death:
        - define plot <player.location.plotsquared_plot||null>
        - if <def[plot]> == null {
            - queue clear
        }
        - if <server.has_flag[Plots.<def[plot]>.Config.drop_item]> {
            - drop <server.flag[Plots.<def[plot]>.Config.drop_item]> <player.location.add[0,0.2,0]>
        }
        - if <server.has_flag[Plots.<def[plot]>.Config.respawn_home]> {
            - if <player.has_flag[Plot_Respawn_Timer]> {
                - narrate format:util_ff "<&e>Plot-Respawn for dette plot er blevet slået fra automatisk!" targets:<def[plot].cuboid.list_players||li@>
                - flag server Plots.<def[plot]>.Config.respawn_home:!
            }
            else {
                - flag player Plot_Respawn_Home:<def[plot].home>
            }
        }

        on player respawn:
        - if <player.has_flag[Plot_Respawn_Home]> {
            - wait 4t
            - teleport <player> <player.flag[Plot_Respawn_Home]>
            - flag player Plot_Respawn_Timer duration:5s
            - flag player Plot_Respawn_Home:!
        }

        on gm command:
        - inject Plot_Config_Gamemode_Command_Check

        on gamemode command:
        - inject Plot_Config_Gamemode_Command_Check

        on survival command:
        - inject Plot_Config_Gamemode_Command_Check

        on creative command:
        - inject Plot_Config_Gamemode_Command_Check

        on gm1 command:
        - inject Plot_Config_Gamemode_Command_Check

        on gm0 command:
        - inject Plot_Config_Gamemode_Command_Check

        on gms command:
        - inject Plot_Config_Gamemode_Command_Check

        on gmc command:
        - inject Plot_Config_Gamemode_Command_Check

        # on player changes gamemode:
        # - inject Plot_Config_Gamemode_Command_Check

        on plotsquared player enters plotsquaredplot:
        - define plot <context.plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.Announce_JoinLeave]> {
            - wait 2t
            - if <player.flag[Announce_JoinLeave_Cooldown]||null> != <def[plot]> {
                - narrate format:util_ff "<&e><player.name> joined <def[plot].owners.get[1].name>'s plot" targets:<def[plot].cuboid.list_players||li@>
            }
            - flag player Announce_JoinLeave_Cooldown:<def[plot]> duration:3s
        }
        - if <server.has_flag[Plots.<def[plot]>.Config.lock_gamemode]> {
            - inject Plot_Config_Ignore_OwnerTrust_Task
            - define gm <server.flag[Plots.<def[plot]>.Config.lock_gamemode]>
            - if <player.gamemode> != <def[gm]> {
                - flag player Last_Gamemode:<player.gamemode>
                - narrate format:util_ff "<&7>Dette plot-gamemode er låst til<&co> <&6><def[gm]>"
                - adjust <player> gamemode:Spectator
            }
        }

        on plotsquared player leaves plotsquaredplot:
        - define plot <context.plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.Announce_JoinLeave]> {
            - narrate format:util_ff "<&e><player.name> forlod <def[plot].owners.get[1].name>'s plot" targets:<def[plot].cuboid.list_players||li@>
        }
        - if <player.has_flag[Last_Gamemode]> {
            - define gm <player.flag[Last_Gamemode]>
            - narrate format:util_ff "<&7>Du er blevet sat tilbage til <player.flag[Last_Gamemode]>"
            - adjust <player> gamemode:<player.flag[Last_Gamemode]>
            - flag player Last_Gamemode:!
        }

        on player clicks Plot_Config_Item_Time in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.flag[Plots.<def[plot]>.Config.Time]||null> == "Aften" {
            - flag server Plots.<def[plot]>.Config.Time:Nat
            - execute as_player "plot flag set time 18000"
        }
        else if <server.flag[Plots.<def[plot]>.Config.Time]||null> == Nat {
            - execute as_player "plot flag set time 0"
            - flag server Plots.<def[plot]>.Config.Time:Morgen
        }
        else if <server.flag[Plots.<def[plot]>.Config.Time]||null> == Morgen {
            - execute as_player "plot flag set time 6000"
            - flag server Plots.<def[plot]>.Config.Time:!
        }
        else {
            - execute as_player "plot flag set time 12000"
            - flag server Plots.<def[plot]>.Config.Time:Aften
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu


        on player clicks Plot_Config_Item_Weather in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.flag[Plots.<def[plot]>.Config.Weather]||null> == Rain {
            - flag server Plots.<def[plot]>.Config.Weather:!
            - execute as_player "plot flag set weather sunny"
        }
        else {
            - flag server Plots.<def[plot]>.Config.Weather:Rain
            - execute as_player "plot flag set weather rain"
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player clicks Plot_Config_Item_LockGamemode in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Survival {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:Adventure
        }
        else if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Adventure {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:Spectator
        }
        else if <server.flag[Plots.<def[plot]>.Config.lock_gamemode]||null> == Spectator {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.lock_gamemode:Survival
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player clicks Plot_Config_Item_SetPlotHome in Plot_Config_MainMenu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "plot sethome"

        on player clicks Plot_Config_Item_PlotMines in Plot_Config_MainMenu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "mine"

        on player clicks Plot_Config_Item_ArmorStandTools in Plot_Config_MainMenu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "ast"

        on player clicks Plot_Config_Item_DropBeacon in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_Item_NonPvP_Zones in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_nonpvp_Menu

        on player clicks Plot_Config_Item_Back in inventory:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player clicks Plot_Config_Item_JoinLeave in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.Announce_JoinLeave]||null> {
            - flag server Plots.<def[plot]>.Config.Announce_JoinLeave:!
        }
        else {
            - define msg "<&a>Slået til"
            - flag server Plots.<def[plot]>.Config.Announce_JoinLeave:<def[msg]>
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        on player clicks Plot_Config_Item_RespawnHome in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.respawn_home]||null> {
            - flag server Plots.<def[plot]>.Config.respawn_home:!
        }
        else {
            - define msg "<&a>Slået til"
            - flag server Plots.<def[plot]>.Config.respawn_home:<def[msg]>
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu

        # 
        on player clicks Plot_Config_Item_DropType in Plot_Config_MainMenu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define type <player.item_in_hand.material.name>
        - if <def[type]> == air {
            - flag server Plots.<def[plot]>.Config.drop_item:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.drop_item:<def[type]>
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_MainMenu


        on player drags in Plot_Config_MainMenu:
        - determine cancelled passively

Plot_Config_Ignore_OwnerTrust_Task:
    type: task
    script:
    # - define plot 
    - if <def[plot]> == null {
        - queue clear
    }
    - if <def[plot].owners.include[<def[plot].trusted>].contains[<player>]||true> {
        - queue clear
    }

Plot_Config_Gamemode_Command_Check:
    type: task
    script:
    - define plot <player.location.plotsquared_plot||null>
    - inject Plot_Config_Ignore_OwnerTrust_Task
    - if <server.has_flag[Plots.<def[plot]>.Config.lock_gamemode]> {
        - determine cancelled passively
        - narrate format:util_ff "<&c>Dette plot har gamemode låst til <&e><server.flag[Plots.<def[plot]>.Config.lock_gamemode]>"
        - narrate format:util_ff "<&7>Hvis du gerne vil ud,  brug <&b>/spawn"
        - queue clear
    }

Plot_Config_Command:
    type: command
    name: plotconfig
    usage: /plotconfig
    description: Command to open config for plot
    aliases:
    - pconfig
    - pmeconfig
    - plotcon
    - config
    - pcon
    script:
    - inject Plot_Config_OpenMenu

Plot_Config_OpenMenu:
    type: task
    script:
    - define plot <player.location.plotsquared_plot||null>
    - if <def[plot]> == null {
        - narrate format:util_ff "<&c>Du er ikke  noget plot!"
        - queue clear
    }
    - if <def[plot].owners.include[<def[plot].trusted>].deduplicate.contains[<player>].not||true> {
        - narrate format:util_ff "<&c>Du er ikke ejer eller trusted  dette plot!"
        - queue clear
    }
    - flag player Plot_Config_Target:<def[plot]>
    - flag server Plot_Config_Target:<def[plot]>
    - inventory open d:in@Plot_Config_MainMenu

##############################################################################################################
############ Main Menu
##############################################################################################################           

Plot_Config_MainMenu:
  type: inventory 
  inventory: CHEST
  title: <&3>Plot Config
  size: 27
  definitions: 
    GM: Plot_Config_Item_LockGamemode
    # Cmds: Plot_Config_Item_CommandSettings
    Time: Plot_Config_Item_Time
    Weather: Plot_Config_Item_Weather
    Home: Plot_Config_Item_SetPlotHome
    PlotMines: Plot_Config_Item_PlotMines
    AST: Plot_Config_Item_ArmorStandTools
    JoinLeave: Plot_Config_Item_JoinLeave
    DropType: Plot_Config_Item_DropType
    # NoteBlock: Plot_Config_Item_Music
    BeaconDrop: Plot_Config_Item_DropBeacon
    NonPvP: Plot_Config_Item_NonPvP_Zones
    Respawn: Plot_Config_Item_RespawnHome
  slots:
    - "[] [GM] [Time] [Weather] [JoinLeave] [DropType] [Respawn] [] []"
    - "[] [Home] [PlotMines] [AST] [NonPvP] [] [] [] []"
    - "[] [BeaconDrop] [] [] [] [] [] [] []"

# Block /gm

## Lock Commandoer
# Kan ikke bruge kommandoer undtagen whitelisted
# /gm (Gamemode Kommandoer)
# /god
# /fly
# /tpyes/tpa/back/home/thru/top(Teleport Kommandoer) (Compass) 
# /item/kit (Spawn item/kits)
# /eec/craft/enderchest (Kister/Craft Kommandoer)
# /ast
# /mines
# /speed (default sat til 1 hvis slået fra)
# /

## Block Perm


Plot_Config_Item_Toggle_Proc:
    type: procedure
    definitions: type|opposite
    script:
    - define plot <server.flag[Plot_Config_Target].as_plotsquared_plot>
    - if <server.has_flag[Plots.<def[plot]>.Config.<def[type]>]> {
        - if <def[opposite].exists> {
            - determine "<&c>Slået Fra"
        }
        - determine "<&a><server.flag[Plots.<def[plot]>.Config.<def[type]>]>"
    }
    - if <def[opposite].exists> {
        - determine "<&a>Slået Til"
    }
    - determine "<&c>Slået Fra"

Plot_Config_Item_Amount_Proc:
    type: procedure
    definitions: type|default
    script:
    - define plot <server.flag[Plot_Config_Target].as_plotsquared_plot>
    - if <server.has_flag[Plots.<def[plot]>.Config.<def[type]>]> {
        - determine "<&a><server.flag[Plots.<def[plot]>.Config.<def[type]>]>"
    }
    - determine "<&a><def[default]>"

Plot_Config_Item_LockGamemode:
    type: item
    material: LOG
    display name: <&b><&l>Force Gamemode
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[lock_gamemode]>"
    - "<&3>Låser dit gamemode  dit plot"
    - "<&3> spillere ikke kan ændre deres gamemode."
    - "<&3>Hvis en spiller ikke er i den korrekte gamemode,"
    - "<&3>bliver de istedet sat til spectator."
    - "<&e>En spiller skal ændre sit gamemode"
    - "<&e>før de træder ind  plottet!"

Plot_Config_Item_Time:
    type: item
    material: WATCH
    display name: <&b><&l>Time
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[time]>"
    - "<&3>Ændre tiden  dit plot for dig og dine spillere."
    - "<&3>Nogen ting ser bedre ud om natten."

Plot_Config_Item_CommandSettings:
    type: item
    material: COMMAND
    display name: <&b><&l>Command Settings
    lore:
    - "<&3>Åbner indstillinger hvor du kan"
    - "<&3>ændre adgang til hvilke kommandoer"
    - "<&3>spillere har adgang til  dit plot."
    - "<&e>Ikke alle kommandoer kan ændres!"

Plot_Config_Item_Weather:
    type: item
    material: GHAST_TEAR
    display name: <&b><&l>Weather
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[weather]>"
    - "<&3>Ændrer vejret  dit plot."
    - "<&e>Regn og Sne kan give client lag!"

Plot_Config_Item_SetPlotHome:
    type: item
    material: BED
    display name: <&b><&l>Set Plot Home
    lore:
    - "<&3>Sætter dit plot home til der hvor du står."
    - "<&3>Dette fungere ligesom at sætte spawn."
    - "<&3>Spillere der teleportere til dit plot, vil"
    - "<&3>blive teleportet til det home du har sat."

Plot_Config_Item_KitSettings:
    type: item
    material: DIAMOND_SWORD
    display name: <&b><&l>Kit Settings
    lore:
    - "<&3>Åbner indstillinger til plot kits."
    - "<&3>Opret eller ændre kits  dit plot."

Plot_Config_Item_PlotMines:
    type: item
    material: IRON_BLOCK
    display name: <&b><&l>Plot Mines
    lore:
    - "<&3>Åbner menu til at vælge plot miner."
    - "<&3>Opretter dine egne miner"
    - "<&3>som genopfylder automatisk."

Plot_Config_Item_RespawnHome:
    type: item
    material: BED
    display name: <&b><&l>Home Respawn
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[respawn_home]>"
    - "<&3>Hvis en spiller dør  dit plot,"
    - "<&3> respawner de  plot home."
    - "<&e>Deaktivere automatisk hvis det abuses."
    # VIP ?

Plot_Config_Item_DropType:
    type: item
    material: NETHER_STAR
    display name: <&b><&l>Death Drop Item
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[drop_item]>"
    - "<&3>Vælger et item som du har i hånden."
    - "<&3>Når en spiller dør, droppes der"
    - "<&3>også det item som er valgt."

Plot_Config_Item_JoinLeave:
    type: item
    material: DIAMOND
    display name: <&b><&l>Join/Leave Broadcast
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[Announce_JoinLeave]>"
    - "<&3>Broadcaster  dit plot når en"
    - "<&3>spiller kommer eller forlader dit plot"

Plot_Config_Item_ComboKills:
    type: item
    material: DIAMOND_AXE
    display name: <&b><&l>Combo Kills
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[combo]>"
    - "<&3>Combo system  dit plot."
    - "<&3>Bruges til "
    - "<&3>Op til 100 combo med broadcast og effekter."
    # VIP ?

Plot_Config_Item_DropBeacon:
    type: item
    material: BEACON
    display name: <&b><&l>Drop Beacon Indstillinger
    lore:
    - "<&3>Åbner indstillinger til din drop beacon."
    - "<&3>Derinde kan du også opsætte din drop beacon."

Plot_Config_Item_ArmorStandTools:
    type: item
    material: ARMOR_STAND
    display name: <&b><&l>Armor Stand Tools
    lore:
    - "<&3>Sætter i dig ArmorStandTools Mode"
    - "<&3>Bruges til at redigere armor stands."
    - "<&3>Kan også bruges til at lave hologrammer."

Plot_Config_Item_NonPvP_Zones:
    type: item
    material: CARPET,14
    display name: <&b><&l>Non-PvP Zoner
    lore:
    - "<&3>Opretter non-pvp zoner  dit plot."
    - "<&3>Non pvp zoner gør at spillere"
    - "<&3>ikke kan pvp i et bestemt"
    - "<&3>område  dit plot."



Plot_Config_Item_Back:
    type: item
    material: BARRIER
    display name: <&b><&l>Back
    lore:
    - "<&3>Går tilbage til hovedmenuen."

##############################################################################################################
############ Drop Beacon
##############################################################################################################

Plot_Config_Menu_DropBeacon_Events:
    type: world
    events:
        on player clicks Plot_Config_DropBeacon_Item_Setup in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "setbeacon"

        on player clicks Plot_Config_DropBeacon_Item_Need in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define flag <server.flag[Plots.<def[plot]>.Config.DropBeacon.Players_Need]||null>
        - if <def[flag]> == 5 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:10
        }
        else if <def[flag]> == 10 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:15
        }
        else if <def[flag]> == 15 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:20
        }
        else if <def[flag]> == 20 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:25
        }
        else if <def[flag]> == 25 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:50
        }
        else if <def[flag]> == 50 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:1
        }
        else if <def[flag]> == 1 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Players_Need:5
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Amount in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define flag <server.flag[Plots.<def[plot]>.Config.DropBeacon.Amount]||null>
        - if <def[flag]> == 150 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:200
        }
        else if <def[flag]> == 200 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:10
        }
        else if <def[flag]> == 10 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:25
        }
        else if <def[flag]> == 25 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:50
        }
        else if <def[flag]> == 50 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:80
        }
        else if <def[flag]> == 80 {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Amount:150
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Cooldown in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define flag <server.flag[Plots.<def[plot]>.Config.DropBeacon.Cooldown]||null>
        - if <def[flag]> == 30m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:60m
        }
        else if <def[flag]> == 60m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:1m
        }
        else if <def[flag]> == 1m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:3m
        }
        else if <def[flag]> == 3m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:5m
        }
        else if <def[flag]> == 5m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:10m
        }
        else if <def[flag]> == 10m {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Cooldown:30m
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Countdown in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.DropBeacon.Countdown]||null> {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Countdown:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Countdown:5s
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Knockback in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.DropBeacon.Ignore_Knockback]||null> {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Ignore_Knockback:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Ignore_Knockback
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Lightning in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.DropBeacon.Skip_Lightning]> {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Skip_Lightning:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Skip_Lightning
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Type in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - define type <player.item_in_hand.material.name||air>
        - if <def[type]> == air {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Drop_Type:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Drop_Type:<def[type]>
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player clicks Plot_Config_DropBeacon_Item_Staff_Only in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively
        - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
        - if <server.has_flag[Plots.<def[plot]>.Config.DropBeacon.Staff_Only_Active]> {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Staff_Only_Active:!
        }
        else {
            - flag server Plots.<def[plot]>.Config.DropBeacon.Staff_Only_Active
        }
        - flag server Plot_Config_Target:<def[plot]>
        - inventory open d:in@Plot_Config_DropBeacon_Menu

        on player drags in Plot_Config_DropBeacon_Menu:
        - determine cancelled passively

Plot_Config_DropBeacon_Menu:
  type: inventory 
  inventory: CHEST
  title: <&3>Drop Beacon Instillinger
  size: 27
  definitions: 
    Back: Plot_Config_Item_Back
    Setup: Plot_Config_DropBeacon_Item_Setup
    Type: Plot_Config_DropBeacon_Item_Type
    Need: Plot_Config_DropBeacon_Item_Need
    Cooldown: Plot_Config_DropBeacon_Item_Cooldown
    Amount: Plot_Config_DropBeacon_Item_Amount
    Countdown: Plot_Config_DropBeacon_Item_Countdown
    Knockback: Plot_Config_DropBeacon_Item_Knockback
    Lightning: Plot_Config_DropBeacon_Item_Lightning
    Staff_Only: Plot_Config_DropBeacon_Item_Staff_Only
  slots:
    - "[Back] [] [] [] [Type] [Need] [Cooldown] [Amount] []"
    - "[] [] [Setup] [] [Countdown] [Knockback] [Lightning] [Staff_Only] []"
    - "[] [] [] [] [] [] [] [] []"

Plot_Config_DropBeacon_Item_Setup:
    type: item
    material: BEACON
    display name: <&b><&l>Install Drop Beacon
    lore:
    - "<&3>Opsætter drop beacon til en beacon block."
    - "<&3>Dette fungere ligesom /setbeacon"

Plot_Config_DropBeacon_Item_Type:
    type: item
    material: slime_ball
    display name: <&b><&l>Drop Type
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Drop_Type|NETHER_STAR]>"
    - "<&3>Sætter det den skal droppe"
    - "<&3>til det du har i din hånd."

Plot_Config_DropBeacon_Item_Need:
    type: item
    material: HUMAN_SKULL
    display name: <&b><&l>Players Needed
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Players_Need|<s@DropBeacon_Data.yaml_key[config.players]>]>"
    - "<&3>Sætter hvor mange spillere"
    - "<&3>der skal være  dit plot."

Plot_Config_DropBeacon_Item_Amount:
    type: item
    material: NETHER_STAR
    display name: <&b><&l>Drop Amount
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Amount|<s@DropBeacon_Data.yaml_key[config.amount.drop_total]>]>"
    - "<&3>Sætter hvor meget der skal"
    - "<&3>droppes hver gang."

Plot_Config_DropBeacon_Item_Cooldown:
    type: item
    material: WATCH
    display name: <&b><&l>Cooldown
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Cooldown|<s@DropBeacon_Data.yaml_key[config.cooldown]>]>"
    - "<&3>Sætter cooldown  mellem hvert drop."

Plot_Config_DropBeacon_Item_Countdown:
    type: item
    material: COMPASS
    display name: <&b><&l>Countdown
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Amount_Proc].context[DropBeacon.Countdown|30s]>"
    - "<&3>Sætter nedtællingen  tiden man"
    - "<&3>har aktiveret den og til den starter."

Plot_Config_DropBeacon_Item_Knockback:
    type: item
    material: CLAY_BRICK
    display name: <&b><&l>Knockback
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[DropBeacon.Ignore_Knockback|true]>"
    - "<&3>Slår til eller fra om spillere,"
    - "<&3>i nærheden af Drop Beacon, skal "
    - "<&3>modtage knockback når den starter."
    - "<&3>Knockback er til dem som står AFK."

Plot_Config_DropBeacon_Item_Lightning:
    type: item
    material: Sulphur
    display name: <&b><&l>Lightning Effect
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[DropBeacon.Skip_Lightning|true]>"
    - "<&3>Slår torden effekten til eller fra."
    - "<&3>Dette køre når drop beacon starter."
    - "<&3>Nogen kan li effekten, andre kan ikke."
    - "<&e>Torden effekt kan give FPS drop!"

Plot_Config_DropBeacon_Item_Staff_Only:
    type: item
    material: BONE
    display name: <&b><&l>Trusted Only Activate
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[DropBeacon.Staff_Only_Active]>"
    - "<&3>Gør  kun ejeren eller dem der er"
    - "<&3>trusted  plottet kan aktivere drop beacon."


##############################################################################################################
############ Non PvP Zones
##############################################################################################################

Plot_Config_Menu_N_Events:
    type: world
    events:

        on player clicks Plot_Config_nonpvp_Item_Setup in Plot_Config_nonpvp_Menu:
        - determine cancelled passively
        - inventory close d:<context.inventory>
        - execute as_player "setbeacon"

        on player clicks Plot_Config_nonpvp_Item_Setup1 in Plot_Config_nonpvp_Menu:
        - define type One
        - inject Plot_Config_nonpvp_region_task

        on player clicks Plot_Config_nonpvp_Item_Setup2 in Plot_Config_nonpvp_Menu:
        - define type Two
        - inject Plot_Config_nonpvp_region_task

        on player clicks Plot_Config_nonpvp_Item_Setup3 in Plot_Config_nonpvp_Menu:
        - define type Three
        - inject Plot_Config_nonpvp_region_task

        on player drags in Plot_Config_nonpvp_Menu:
        - determine cancelled passively

Plot_Config_nonpvp_region_task:
    type: task
    script:
    - determine cancelled passively
    - define plot <player.flag[Plot_Config_Target].as_plotsquared_plot>
    - define region <player.selected_region||null>
    - if <def[region]> == null {
        - narrate format:util_ff "<&c>Du skal have markeret et område med WorldEdit"
        - queue clear
    }
    - define world <def[plot].world>
    - define region_id "NonPvP_<def[world].name>_<def[plot].x>_<def[plot].z>_<def[type]>"
    - if <server.has_flag[Plots.<def[plot]>.Config.nonpvp.zones.<def[type]>]> {
        - region remove <def[world]> id:<def[region_id]>
        - flag server Plots.<def[plot]>.Config.nonpvp.zones.<def[type]>:!
        - narrate format:util_ff "<&a>Fjernet Non-PvP Zone"
    }
    else {
        - if <def[region].is_within[<def[plot].cuboid>].not> {
            - narrate format:util_ff "<&c>Dit markeret region er ikke inde for dit plot"
            - inventory close d:<context.inventory>
            - queue clear
        }
        - region add <def[region]> id:<def[region_id]>
        - execute as_server "region flag -w <def[world].name> <def[region_id]> pvp deny"
        - execute as_server "region flag -w <def[world].name> <def[region_id]> passthrough allow"
        - flag server Plots.<def[plot]>.Config.nonpvp.zones.<def[type]>:<def[region].after[cu@]>
        - narrate format:util_ff "<&a>Oprettet Non-PvP Zone"
    }
    - flag server Plot_Config_Target:<def[plot]>
    - inventory open d:in@Plot_Config_nonpvp_Menu

Plot_Config_nonpvp_Menu:
  type: inventory 
  inventory: CHEST
  title: <&3>NonPvP Instillinger
  size: 27
  definitions: 
    Back: Plot_Config_Item_Back
    Setup1: Plot_Config_nonpvp_Item_Setup1
    Setup2: Plot_Config_nonpvp_Item_Setup2
    Setup3: Plot_Config_nonpvp_Item_Setup3
  slots:
    - "[Back] [] [] [Setup1] [Setup2] [Setup3] [] [] []"
    - "[] [] [] [] [] [] [] [] []"
    - "[] [] [] [] [] [] [] [] []"

Plot_Config_nonpvp_Item_Setup1:
    type: item
    material: BEACON
    display name: <&b><&l>Setup Non PvP Zone 1
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[nonpvp.zones.One]>"
    - "<&3>Opsætter et Non PvP Zone med din marking i WorldEdit."
    - "<&3>Du kan klikke igen for at fjerne Pvp Zonen."

Plot_Config_nonpvp_Item_Setup2:
    type: item
    material: BEACON
    display name: <&b><&l>Setup Non PvP Zone 2
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[nonpvp.zones.Two]>"
    - "<&3>Opsætter et Non PvP Zone med din marking i WorldEdit."
    - "<&3>Du kan klikke igen for at fjerne Pvp Zonen."

Plot_Config_nonpvp_Item_Setup3:
    type: item
    material: BEACON
    display name: <&b><&l>Setup Non PvP Zone 3
    lore:
    - "<&3>Status<&co> <proc[Plot_Config_Item_Toggle_Proc].context[nonpvp.zones.Three]>"
    - "<&3>Opsætter et Non PvP Zone med din marking i WorldEdit."
    - "<&3>Du kan klikke igen for at fjerne Pvp Zonen."


##############################################################################################################
############ Plot Kit Zones
##############################################################################################################

Plot_Config_Menu_N_Events:
    type: world
    events:
        on player clicks Plot_Config_plotkit_Item_Setup1 in Plot_Config_plotkit_Menu:
        - execute as_server "pkit create"

        on player clicks Plot_Config_plotkit_Item_Setup2 in Plot_Config_plotkit_Menu:
        - execute as_server "pkit create"

        on player clicks Plot_Config_plotkit_Item_Setup3 in Plot_Config_plotkit_Menu:
        - execute as_server "pkit create"

        on player drags in Plot_Config_plotkit_Menu:
        - determine cancelled passively

Plot_Config_Item_Kit_Proc:
    type: procedure
    definitions: kit_pos
    script:
    - define plot <server.flag[Plot_Config_Target]>
    - if <server.flag[Plots.<def[plot]>.Config.Plot_Kits].as_list.size||0> >= <def[kit_pos]> {
        - define kit <server.flag[Plots.<def[plot]>.Config.Plot_Kits].as_list.get[<def[kit_pos]>]>
        - determine "STAINED_GLASS_PANE,3[lore=<server.flag[Plots.<def[plot]>.Config.Plot_Kit_Lore.<def[kit]>]>"
    }
    - determine "STAINED_GLASS_PANE,15"

Plot_Config_plotkit_Menu:
  type: inventory 
  inventory: CHEST
  title: <&3>Plot Kit Instillinger
  size: 27
  definitions: 
    Back: Plot_Config_Item_Back
    Setup1: Plot_Config_plotkit_Item_Setup1
    Setup2: Plot_Config_plotkit_Item_Setup2
    Setup3: Plot_Config_plotkit_Item_Setup3
    Kit1: <proc[Plot_Config_Item_Kit_Proc].context[1]>
    Kit2: <proc[Plot_Config_Item_Kit_Proc].context[2]>
    Kit3: <proc[Plot_Config_Item_Kit_Proc].context[3]>
  slots:
    - "[Back] [] [] [Setup1] [Setup2] [Setup3] [] [] []"
    - "[] [] [] [Kit1] [Kit2] [Kit3] [] [] []"
    - "[] [] [] [] [] [] [] [] []"

Plot_Config_plotkit_Item_Setup1:
    type: item
    material: 
    display name: <&b><&l>Setup Plot Kit 1
    lore:
    - "<&3>Opsætter et Kit  dit plot 
    - "<&3>ud fra det du har i din inventory."
    - "<&e>Du skal lave dit kit i din inventory!"
    - "<&3>Du kan klikke igen for at fjerne dette kit."

Plot_Config_plotkit_Item_Setup2:
    type: item
    material: STAINED_GLASS_PANE,15
    display name: <&b><&l>Setup Plot Kit 2
    lore:
    - "<&3>Opsætter et Kit  dit plot 
    - "<&3>ud fra det du har i din inventory."
    - "<&e>Du skal lave dit kit i din inventory!"
    - "<&3>Du kan klikke igen for at fjerne dette kit."

Plot_Config_plotkit_Item_Setup3:
    type: item
    material: STAINED_GLASS_PANE,15
    display name: <&b><&l>Setup Plot Kit 3
    lore:
    - "<&3>Opsætter et Kit  dit plot 
    - "<&3>ud fra det du har i din inventory."
    - "<&e>Du skal lave dit kit i din inventory!"
    - "<&3>Du kan klikke igen for at fjerne dette kit."