Paste #41884: Untitled Paste

Date: 2017/05/16 09:38:11 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: "monster_egg[spawn_egg=103]" 
    display name: "<&3>Llama" 
    lore: 
    - "<&a><&f>5000" 
Donkey: 
    type: item 
    material: "monster_egg[spawn_egg=31]" 
    display name: "<&6>Donkey" 
    lore: 
    - "<&a><&f>5000" 
Mule: 
    type: item 
    material: "monster_egg[spawn_egg=32]" 
    display name: "<&4>Mule" 
    lore: 
    - "<&a><&f>5000" 
Vex:
    type: item 
    material: "monster_egg[spawn_egg=35]" 
    display name: "<&e>Vex" 
    lore: 
    - "<&a><&f>8000" 
Horse: 
    type: item 
    material: "monster_egg[spawn_egg=100]" 
    display name: "<&4>Horse" 
    lore: 
    - "<&a><&f>3000" 
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 duration2h 
            } 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." 
            - give 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