Paste #78328: Untitled Paste

Date: 2020/12/01 01:23:35 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


TeleporterNPC:
    type: assignment
    debug: true
    actions:
        on assignment:
        - trigger name: click state:true
        on click:
        - if <player.item_in_hand.material.name> == emerald:
            - playsound <player> ENTITY_VILLAGER_NO
            - narrate "<&f>Let me count those real quick.<&f>."
            - wait 1s
            - repeat 16:
                - if <player.item_in_hand.material.name> == emerald
                    - playsound <player> ENTITY_EXPERIENCE_ORB_PICKUP
                    - take iteminhand
                    - wait 0.15s
                    - define Count:+:1
                - else:
                    - playsound <player> ENTITY_VILLAGER_NO
                    - narrate "<&f>That's just <&3><[Count]> Emeralds!"
                    - wait 1
                    - playsound <player> ENTITY_VILLAGER_NO
                    - narrate "Sorry, but i won't sell a scroll for those."
                    - give <player> emerald qty:<[Count]>
                    - define Count:0
                    - stop
            - if <[Count]> == 16:
                - playsound <player> ENTITY_VILLAGER_CELEBRATE
                - narrate "Alright. Take your <&6>Farwater Teleport Scroll<&f>."
                - give <item[FarwaterTeleportScroll]>
        - if <player.item_in_hand.material.name> == diamond:
            - playsound <player> ENTITY_VILLAGER_NO
            - narrate "<&f>Let me count those real quick.<&f>."
            - wait 1s
            - repeat 32:
                - if <player.item_in_hand.material.name> == diamond
                    - playsound <player> ENTITY_EXPERIENCE_ORB_PICKUP
                    - take iteminhand
                    - wait 0.15s
                    - define Count:+:1
                - else:
                    - playsound <player> ENTITY_VILLAGER_NO
                    - narrate "<&f>That's just <&3><[Count]> Diamonds!"
                    - wait 1
                    - playsound <player> ENTITY_VILLAGER_NO
                    - narrate "Sorry, but i won't sell a scroll for those."
                    - give <player> diamond qty:<[Count]>
                    - define Count:0
                    - stop
            - if <[Count]> == 32:
                - playsound <player> ENTITY_VILLAGER_CELEBRATE
                - narrate "Alright. Take your <&6>Farwater Teleport Scroll<&f>."
                - give <item[FarwaterTeleportScroll]>
        - else:
            - playsound <player> ENTITY_VILLAGER_NO
            - narrate "I'm making these scrolls everone is talking about."
            - wait 2s
            - playsound <player> ENTITY_VILLAGER_NO
            - narrate "<&f>You can buy one for 16 <&3>emeralds <&f>or 32 <&b>diamonds<&f>."