KitSystem_Version: type: version name: KitSystem id: 108 description: A kit system with a menu and config for all players. version: 2 KitSystem_Config: type: yaml data config: permission: "essentials.kits.%kit%" default_order: - Sword - Bow - Rod - Gaps - Food - Armor - Arrow order_items: Sword: 'i@diamond_sword[display_name=&dSword]' Bow: 'i@bow[display_name=&dBow]' Rod: 'i@fishing_rod[display_name=&dRod]' Gaps: 'i@GOLDEN_APPLE[display_name=&dGaps;lore=&7May not be included in /kit pvp]' Food: 'i@cooked_beef[display_name=&dFood]' Armor: 'i@iron_chestplate[display_name=&dAll Armor;lore=&7Helmet|&7Chestplate|&7Leggings|&7Boots]' Arrow: 'i@arrow[display_name=&dArrows]' kits: # Edit your kits below here PvP: permission: essentials.kits.pvp cooldown: 10 items: Sword: - i@diamond_sword Bow: - i@bow Rod: - i@fishing_rod Gaps: [] Food: - i@cooked_beef[quantity=16] Armor: - i@iron_helmet - i@iron_chestplate - i@iron_leggings - i@iron_boots Arrow: - i@arrow[quantity=64] Master: permission: essentials.kits.master cooldown: 36000 items: Sword: - i@diamond_sword[display_name=&aMaster;enchantments=DAMAGE_ALL,2|DURABILITY,1] Bow: - i@bow[display_name=&aMaster;enchantments=ARROW_DAMAGE,2|DURABILITY,1] Rod: - i@fishing_rod Gaps: - i@GOLDEN_APPLE[quantity=4] Food: - i@cooked_beef[quantity=16] Armor: - i@diamond_helmet[display_name=&aMaster;enchantments=PROTECTION_ENVIRONMENTAL,3] - i@diamond_chestplate[display_name=&aMaster;enchantments=PROTECTION_ENVIRONMENTAL,2] - i@diamond_leggings[display_name=&aMaster;enchantments=PROTECTION_ENVIRONMENTAL,2] - i@diamond_boots[display_name=&aMaster;enchantments=PROTECTION_ENVIRONMENTAL,2] Arrow: - i@arrow[quantity=64] Master1: permission: essentials.kits.Master1 cooldown: 10 items: Sword: - i@diamond_sword Bow: - i@bow Rod: - i@fishing_rod Gaps: [] Food: - i@cooked_beef[quantity=16] Armor: - i@diamond_helmet - i@iron_chestplate - i@iron_leggings - i@diamond_boots Arrow: - i@arrow[quantity=64] KitSystem_Events: type: world debug: false events: # BC's data tracker. on system time hourly: - webget "http://stats.denizenscript.com/tracker?script=&version=" on player respawns: - if { - wait 10t - if { - if { - execute as_player "kit master1" } else { - execute as_player "kit pvp" } } } on player drags in KitSystem_OrderMenu: - determine cancelled on player clicks in KitSystem_OrderMenu: - determine cancelled passively - if == "CONTAINER" { - define order - if <= { - if { - define slot1 - define list - define slot2 - define new_list ]>].at[]> - define new_list ]>].at[]> - flag player KitSystem_sort_config: - flag player KitSystem_SelectedItem:! - flag server "KitSystem_Target_ConfigMenu:" - inject KitSystem_ConfigOrderPrepare } else { - flag player KitSystem_SelectedItem: } } } on player drags in KitSystem_KitsMenu: - determine cancelled on player clicks in KitSystem_KitsMenu: - determine cancelled passively - if ].not||true> { - if == "KitSystem_KitConfigItem" { - execute as_player "kitconfig" } - queue clear } - inventory close d: - define title <&sp>]||null> - if == null { - queue clear } - execute as_player "kit " on player clicks KitSystem_ConfigItem1 in KitSystem_ConfigMenu: - determine cancelled passively - flag server "KitSystem_Target_ConfigMenu:" - inject KitSystem_ConfigOrderPrepare on player clicks KitSystem_ConfigItem2 in KitSystem_ConfigMenu: - determine cancelled passively - if { - flag player KitSystem_Status_AutoKit:! } else { - flag player KitSystem_Status_AutoKit } - flag server "KitSystem_Target_ConfigMenu:" - inventory open d:in@KitSystem_ConfigMenu on player clicks KitSystem_ConfigItem3 in KitSystem_ConfigMenu: - determine cancelled passively - if { - flag player KitSystem_Status_AutoArmor:! } else { - flag player KitSystem_Status_AutoArmor } - flag server "KitSystem_Target_ConfigMenu:" - inventory open d:in@KitSystem_ConfigMenu KitSystem_Command: type: command name: kit description: Kit command to your kits debug: false usage: /kit aliases: - kits script: - if >= 1 { - define kit - if ]||false> { - define permission .permission]> - if ].global.not||true> { - narrate "<&c>No acccess to that kit!" - queue clear } - define cd_flag KitSystem_Cooldown_ - if ]||true> { - narrate "<&7>The kit <&c> <&7>can be taken at <&c>].expiration.formatted>" - queue clear } - narrate "<&3>Giving kit<&co> <&6><&l>" - if { - flag player KitSystem_Notify_Cooldown duration:30m - narrate "<&a>/kitconfig <&3>to change the order of your kit!" } - define itemtypes .items]||i@dirt> - define cooldown .cooldown]||10> - if { - define order - flag player "KitSystem_sort_config:" } - foreach { - define items .items.]> - if { - if == "Armor" { - if { - if == "li@i@air|i@air|i@air|i@air" { - adjust equipment:.items.].parse_color.as_list.reverse> } else { - give .items.].parse_color> } } else { - give .items.].parse_color> } } else { - give .items.].parse_color> } } } - if { - flag player "" "duration:s" } - queue clear } else { - narrate "<&c>That kit does not exist..." } } else { - flag server "KitSystem_Target_KitsMenu:" - inventory open d:in@KitSystem_KitsMenu } KitSystem_KitsMenu: type: inventory debug: false inventory: CHEST title: <&8>Kits Menu size: 27 definitions: Item1: [display_name=;lore=] Item2: [display_name=;lore=] Item3: [display_name=;lore=] Config: KitSystem_KitConfigItem P: STAINED_GLASS_PANE,7 slots: - "[Config] [P] [P] [item1] [item2] [item3] [P] [P] [Config]" KitSystem_KitsMenu_Proc: type: procedure debug: false definitions: line|item script: - define target - define permission .permission]> - define access ]> - choose "": - case "1": - define cd_flag KitSystem_Cooldown_ - if { - if ]> { - determine "STAINED_GLASS_PANE,4" } else { - determine "STAINED_GLASS_PANE,5" } } else { - determine "STAINED_GLASS_PANE,14" } - case "2": - determine "<&6><&l>Kit<&co> " - case "3": - define cd_flag KitSystem_Cooldown_ - if { - if ]> { - determine "<&e>Can be taken in <&b>].expiration.formatted>" } else { - determine "<&a>Ready!" } } else { - determine "<&c>No Access!" } - default: - determine "Chosen default in " KitSystem_KitConfigItem: type: item debug: false material: ENDER_CHEST display name: <&d>KitConfig lore: - <&9>Order, automatic kits, etc. KitSystem_ConfigCommand: type: command name: kitconfig description: Kit command for your kits debug: false usage: /kitconfig script: - flag server "KitSystem_Target_ConfigMenu:" - inventory open d:in@KitSystem_ConfigMenu KitSystem_ConfigOrderPrepare: type: task script: - if { - define order - flag player "KitSystem_sort_config:" } - inventory open d:in@KitSystem_OrderMenu KitSystem_ConfigMenu: type: inventory debug: false inventory: CHEST title: <&6>Kit Config size: 9 definitions: Item1: i@KitSystem_ConfigItem1 Item2: i@KitSystem_ConfigItem2 Item3: i@KitSystem_ConfigItem3 P: STAINED_GLASS_PANE,7 slots: - "[] [] [Item1] [] [Item2] [] [Item3] [] []" KitSystem_ConfigItem1: type: item material: CHEST display name: <&d>Kit Order lore: - <&3>Here you can change the order - <&3>when you get your kit. KitSystem_ConfigItem2: type: item debug: false material: IRON_SWORD display name: <&d>Auto-Kit lore: - <&9>Status<&co> - <&3>When you respawn, your kit - <&3>will be automatic given - <&3>if not on cooldown. KitSystem_ConfigItem3: type: item debug: false material: Iron_Chestplate display name: <&d>Auto-Armor lore: - <&9>Status<&co> - <&3>Your armor is equipped instead - <&3>of being filled in your inventory. - <&3>This only happens when you take your kit. KitSystem_ConfigMenu_Proc: type: procedure debug: false definitions: item script: - define target - define status_flag KitSystem_Status_ - if ]> { - determine "<&c>Turned Off" } else { - determine "<&a>Turned On" } KitSystem_OrderMenu: type: inventory debug: false inventory: CHEST title: <&8>Click on 2 items to swap. size: 9 definitions: Item1: Item2: Item3: Item4: Item5: Item6: Item7: Item8: Item9: slots: - "[Item1] [Item2] [Item3] [Item4] [Item5] [Item6] [Item7] [Item8] [Item9]" KitSystem_OrderMenu_Proc: type: procedure debug: false definitions: item script: - define target - define item ]||null> - determine ].parse_color||i@air>