- 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


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleNPC Shop
TypeDenizen Script
Date2017/01/07 20:35:13 UTC-08:00
ByGuest
Other
Paste
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
2700
Events:
  type: world
  debug: true
  events:
    on player right clicks npc:
    - choose <npc.id>:
      - case "166":  
        - inventory open d:in@Farmer
    on player clicks in Farmer:
    - determine passively cancelled
    - flag player GUIItem:<context.item.material.name>
    - if <player.flag[GUIItem]> != black_stained_glass_pane {
      - inventory open d:in@Money
      }
    on player clicks in Money:
    - determine passively cancelled
    - choose <context.item.display>:
      - case "<&c>Sell 1":
        - if !<player.inventory.contains[<player.flag[GUIItem]>]> {
          - narrate "<&c>You do not have enough of this item."
          - queue clear
          }
        - take <player.flag[GUIItem]> from:<player.inventory>
        - define itemvalue <yaml[worth].read[<server.list_materials>]>
        - give money quantity:<def[itemvalue]>
        - narrate "<&e><context.item.worth> <&A>has been added to your account."



RawRaw



Pastes made: 57256