Staff Pick: Brunos Backpacks
By
BrunoCreated: 2016/01/30 11:41:27 UTC-08:00 (8 years and 328 days ago)
Edited: 2016/01/30 11:41:27 UTC-08:00 (8 years and 328 days ago)
Likes: 0
Staff pick as of: 2016/01/30 13:20:47 UTC-08:00 (8 years and 328 days ago)
Denizen Version: 0.9.7 dev
Script Version: 1.0
Description:
Assign permission to player and they can use the command.
Flag the player with a higher number for bp_level (1-6)
Download script |
View raw scriptbackpack:
type: command
name: backpack
usage: /backpack create/open
description: Backpack command
debug: true
permission: bruno.backpacks
aliases:
- pv
permission message: <&6>Quartermaster <&f>Talk to the boss, you can't use this command.
allowed help:
- determine <player.is_op||<context.server>>
script:
- define bp_qty <player.flag[backpack_qty].round||0>
- define player_name <player.name>
- define bp_level <player.flag[bp_level].round||1>
- define id_number <c.args.get[2]||1>
- define slots <def[bp_level].mul_int[9]||0>
- narrate "<&6>Quartermaster <&f>You have %bp_qty% backpacks currently and you can use level %bp_level% backpacks, which contain %slots% slots for storage."
- choose <c.args.get[1]>:
- case create:
- choose <player.flag[backpack_qty].is[less].to[1]||true>:
- case true:
- flag <player> backpack_qty:+:1
- wait 1t
- define new_id_number <player.flag[backpack_qty].round>
- wait 1t
- note d:in@generic[title=%player_name%<&sp>Backpack<&sp>%new_id_number%;size=%slots%] as:bp_%bp_level%_%player_name%_%new_id_number%
- wait 1t
- narrate "<&6>Quartermaster <&f>Good job, mate, here is your pack. Type '/backpack open %id_number%' or '/bp open %id_number%' to access it."
- case false:
- narrate "<&6>Quartermaster <&f>Ay, mate, you can't create anymore backpacks at the moment okay?"
- case default:
- narrate "<&6>Quartermaster <&f>Nah. Try again mate. <script.yaml_key[usage]>"
- case open:
- define chosen_id <c.args.get[2]>
- choose %chosen_id%:
- case 0:
- narrate "<&6>Quartermaster <&f>Nah. That's not a valid ID number."
- default:
- choose <player.flag[backpack_qty].is[or_more].to[%chosen_id%]>:
- case true:
- inventory open d:in@bp_%bp_level%_%player_name%_%id_number%
- case false:
- narrate "<&6>Quartermaster <&f>Nah. That's not a valid ID number."
- default:
- narrate "<&6>Quartermaster <&f>Nah. Try again mate. <script.yaml_key[usage]>"
- case help:
- narrate "<&6>Quartermaster <&f><script.yaml_key[usage]>"
- default:
- narrate "<&6>Quartermaster <&f>Nah. Try again mate. <script.yaml_key[usage]>"
View History