Paste #41803: Untitled Paste

Date: 2017/05/12 05:55:16 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


animalsellsman_npc:
    type: assignment
    debug: false
    interact scripts:
    - 10 animalselsmanscript

    actions:
        on assignment:
        - trigger name:proximity toggle:true radius:5
        - trigger name:click toggle:true
        - trigger name:chat toggle:true

animalsellsman_inventory:
  type: inventory
  title: "<&6>Djurbutik"
  size: 27
  slots:
  - "[i@Llama] [i@Donkey] [i@Mule] [i@Vex] [i@Horse] [] [] [] []"
  - "[] [] [] [] [] [] [i@Lead] [] []"
  - "[] [] [] [] [] [] [] [] []"

Llama:
    type: item
    material: "383:103"
    display name: "<&3>Lama"
    lore:
    - "<&a><&f>5000"
Donkey:
    type: item
    material: "383:31"
    display name: "<&6>Donkey"
Mule:
    type: item
    material: "383:32"
    display name: "<&4>Mule"
Vex:
    type: item
    material: "383:35"
    display name: "<&e>Vex"
Horse:
    type: item
    material: "383:100"
    display name: "<&2>Horse"
Lead:
    type: item
    material: "420"
    display name: "<&6>Koppel"
    lore:
    - "<&a><&f>800"

animalsellsman_inventory_handler:
    type: world
    events:

        on player clicks in animalsellsman_inventory:
        - determine cancelled
        on player drags in animalsellsman_inventory:
        - determine cancelled

        on player clicks Llama in animalsellsman_inventory:
        - if <player.money> >= "5000" {
            - inventory close
            - money take qty:5000
            - narrate "<&a><&e>5000 <&a>Har blivit draget från ditt konto."
            - give 383:103
            - flag player boughtanimal duration:2h
            } else {
            - inventory close
            - narrate "<yellow>Du har inte tillräckligt med pengar!"
            } 
        on player clicks Donkey in animalsellsman_inventory: 
        - if <player.money> >= "5000" {
            - inventory close
            - money take quantity:5000
            - narrate "<&a><&e>5000 <&a>Har blivit draget från ditt konto."
            - give Donkey
            - flag player boughtanimal duration:2h
            } else {
            - inventory close
            - narrate "<yellow>Du har inte tillräckligt med pengar!"
            } 
        on player clicks Mule in animalsellsman_inventory:
        - if <player.money> >= "5000" {
            - inventory close
            - money take quantity:5000
            - narrate "<&a><&e>5000 <&a>Har blivit draget från ditt konto."
            - execute as_server "give @p spawn_egg 1 0 {EntityTag:{id:minecraft:mule}}""
            - flag player boughtanimal duration:2h
            } else {
            - inventory close
            - narrate "<yellow>Du har inte tillräckligt med pengar!"
            }
        on player clicks Vex in animalsellsman_inventory:
        - if <player.money> >= "8000" {
            - inventory close
            - money take quantity:8000
            - narrate "<&a><&e>8000 <&a>Har blivit draget från ditt konto."
            - give Vex
            - flag player boughtanimal duration:2h
            } else {
            - inventory close
            - narrate "<yellow>Du har inte tillräckligt med pengar!"
            }
        on player clicks Horse in animalsellsman_inventory:
        - if <player.money> >= "3000" {
            - inventory close
            - money take quantity:3000
            - narrate "<&a><&e>3000 <&a>Har blivit draget från ditt konto."
            - give Horse
            - flag player boughtanimal duration:2h
            } else {
            - inventory close 
            - narrate "<yellow>Du har inte tillräckligt med pengar!" 
            } 
        on player clicks Lead in animalsellsman_inventory:
        - if <player.money> >= "800" {
            - inventory close
            - money take quantity:800
            - narrate "<&a><&e>800 <&a>Har blivit draget från ditt konto."
            - give Lead
            } else {
            - inventory close
            - narrate "<yellow>Du har inte tillräckligt med pengar!"
            } 
animalselsmanscript:
    type: interact

    steps:
        one*:
            click trigger:
                script:
                - if <player.has_flag[boughtanimal]> {
                    - narrate "<npc.name>: <green>Du kan inte bara köpa och köpa djur, du måste ta hand om dem också!"
                    - wait 1
                    - narrate "<npc.name>: <green>Kom tillbaka om <player.flag[boughtanimal].expiration.formatted>"
                    - queue clear
                    }
                - narrate "<npc.name>: <green>Välkommen, vad behöver ni idag?"
                - wait 1
                - inventory open d:in@animalsellsman_inventory