- 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








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Brunos Backpacks


By Bruno
Created: 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 script
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
5200

backpack:
  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