#------------------------# #dvchest # #Author:zozer_firehood # # _______ # # / \ # # / ____ \ # #| / ___ | # #| / / __ | # # \ / / / # # \_______/ # #------------------------# # usage /dvc or /dvchest without args will open the chest, the player. perms required: dvchest # /dvc addLimit will increment the lines for the chest for a given player. perms required: dvchest.admin # /dvc add will allow that player to use dvchest. perms required: dvchest.admin DVChest_version: type: version name: DVChest id: 68 description: a private safe chest you can access at any time. version: 1.2 DVChest: type: command debug: true name: dvchest aliases: - dvc tab complete: - define list li@about - if { - if { - define list } } - determine ]]> script: - define arg - choose %arg%: - case add: - if ]> { - define player - if { - narrate 'format:dvchest_format' "<&c>That is not a valid player!" - queue clear } - if { - narrate 'format:dvchest_format' " already has dvchest" - queue clear } - permission add 'dvchest' player:%player% - flag %player% 'dvchestLimit:1' - narrate 'format:dvchest_format' "<&6>You can now use <&4><&l>Dv<&8>chest!" 'targets:%player%' - announce 'format:dvchest_format' "<&a> can now use dvchest" to_console - queue clear } else { - narrate 'format:dvchest_format' "You do not have permission to use this command" } - case addlimit: - if ]> { - define player - if { - narrate 'format:dvchest_format' "<&c>That is not a valid player!" - queue clear } - if { - narrate 'format:dvchest_format' "The maximum amount of lines hav been reached" - queue clear } - flag %player% 'dvchestLimit:++:1' - narrate 'format:dvchest_format' "<&6>You can now have <&f> <&6>lines in your dvchest!" 'targets:%player%' - announce 'format:dvchest_format' "<&a> line limit set to " to_console } else { - narrate 'format:dvchest_format' "You do not have permission to use this command" } - case about: - determine passively fulfilled - narrate "#-----------------------------#" - narrate "#<&4><&l>Dv<&8>chest" - narrate "#Author:zozer_firehood" - narrate "#-----------------------------#" - narrate format:dvchest_format "by utilising 4th dimension space,dvchest allows you to have a safe inventory that you can access at any time" - narrate format:dvchest_format "to access it, just type <&6>/dvchest" - narrate format:dvchest_format "disclaimer: we are not responsible for any infestation that may apear in your dvchest." - narrate format:dvchest_format "this includes, but not limited to: square bacteriaum, time travling rats,random broken glass, and gophers" - default: #checks perms - if ! && ! && %arg% == null { - narrate 'format:dvchest_format' "you havn't unlocked dvchest!" - queue clear } #check for extra args - if ! { - narrate format:dvchest_format "%arg%<&8> is an unkown argument, use /dvc <&8>or /dvchest <&8>to access your dvchest" - queue clear } - run locally loadYAML - define lines - if { - define lines '1' - flag player dvchestLimit:1 } - define dvchest dvchest - note in@generic[title=<&c>dv<&9>Chest;size=;] 'as:%dvchest%' - inventory add 'd:in@%dvchest%' 'o:]>' - inventory open 'd:in@%dvchest%' loadYAML: - if ! { - if ! { - yaml create 'id:dvchestkey' - yaml 'savefile:dvchest/dvchestkey.yml' 'id:dvchestkey' } else { - yaml 'load:dvchest/dvchestkey.yml' 'id:dvchestkey' } } DVChestHandler: type: world debug: true events: on player closes inventory: - if ].is[!=].to[in@dvchest]> queue clear - define dvlist - yaml set 'id:dvchestkey' :%dvlist% - yaml 'savefile:dvchest/dvchestkey.yml' 'id:dvchestkey' dvchest_format: type: format format: <&4><&l>Dv<&8>chest