Paste #30710: Untitled Paste

Date: 2016/02/23 17:48:38 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


XPLvLConvert:
    type: command
    name: xpbottles
    description: Turn all your EXP Levels into XP Bottles!
    usage: /xpbottles
    script: 
    - if <player.xp.level> == 0 {
      - narrate "<&c>You have 0 levels to convert!"
      - queue clear
    }      
    - define xplevels <player.xp.level>
    - define currentxp <player.xp.total>
    - define xpworth <def[currentxp].div[11].round>
    - if <player.has_flag[xpconfirm]> {
      - if <player.money> < 2500 {
        - narrate "<&c>You dont have enough money to convert to XP bottles!"
        - queue clear 
      }
        - take money qty:2500
        - experience take <def[currentxp]>
        - give exp_bottle qty:<def[xpworth]>
        - narrate "<&a>You have successfully converted <def[xplevels]> EXP Levels into <def[xpworth].div[64].as_int> stack(s) and <def[xpworth].mod[64].as_int> bottles"
        - narrate "<&c>$2500 has been deducted from your account."       
        - queue clear
    }
    - narrate "<&a>You are about to convert <def[xplevels]> EXP Levels into <def[xpworth].div[64].as_int> stack(s) and <def[xpworth].mod[64].as_int> bottles"
    - narrate "<&c>Convertion price: $2500"
    - narrate "<&6>Type /xpconvert again to confirm"
    - flag player xpconfirm duration:15s

####################################################################################################################   
#wip <def[currentxp]div.[11]>
#- execute as_server tellraw Alphatrooper {"text":"Click this!","clickEvent":{"action":"run_command","value":"/say Hello!"}}
#tellraw (clickable messages)
####################################################################################################################