xpstore-v1.1 (2).sk

Created by DannyDxmpster

Other available versions. Ordered by newest to oldest versions:

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

options: # CONFIGURATION
    psound: play sound "block.note_block.pling" with volume 1 and pitch 1 at player for player #---- the sound the store plays when opening and closing. you can delete it to stop sounds but you must delete every mention of it in the skript.
    soundlev: play sound "entity.player.levelup" with volume 1 and pitch 1 at player for player # This is the sound made when purchasing any ammount of xp
    bckgrnditem: black stained glass pane #---- this is the item in the background of the store gui
    xpitem: experience bottle #---- the item the shop uses to display the buttons used to buy xp
    additem: lime stained glass pane #---- the item used for the "add 1 level" button in the "buy custom xp" section of the store
    remitem: red stained glass pane #---- the item used for the "remove 1 level" button in the "buy custom xp" section of the store
    shopname: "&8[&cXP-Store&8]" #---- the name of the main store gui
    customitem: skull of ("MHF_QUESTION" parsed as an offline player) #---- the item used for the "buy a custom ammount of xp levels" in the main gui
    xpcost: 8333 # the cost per level of xp
    confname: "&8[&cConfirm Order&8]" #--- the name of the custom xp levels confirm order gui
    confbckgrnd: black stained glass pane #---- the item in the background of the custom xp levels confirm order gui
    version: "V1.1" #---- DO NOT CHANGE THIS!!!
    loadmessage: send "%{sknamemsg}% &eversion %{skvermsg}% &eby DannyDxmpster has &asuccessfully &eloaded!" to loop-player
    authentication: "f#11p19S19#v/1#.1!" #---- DO NOT CHANGE THIS!!!
    loadname: "&cXP-Store" # DO NOT CHANGE THIS!!!

on script load:
    set {sknamemsg} to {@loadname}
    set {skvermsg} to {@version}
    loop all players:
        if loop-player is op:
            {@loadmessage}


command /xpstore:
    trigger:
        {@psound}
        open chest inventory with 3 rows named {@shopname} to player
        set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 11 and 13 and 15 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 and 27 of player's current inventory to {@bckgrnditem} named " "
        set slot 10 of player's current inventory to {@xpitem} named "&eBuy 1 Level of XP"
        set slot 12 of player's current inventory to 5 of {@xpitem} named "&eBuy 5 Levels of XP"
        set slot 14 of player's current inventory to 10 of {@xpitem} named "&eBuy 10 Levels of XP"
        set slot 16 of player's current inventory to {@customitem} named "&eBuy a custom amount of XP Levels"
        
on inventory click:
    if event-slot is black stained glass pane named " ":
        cancel event
    else if event-slot is {@xpitem} named "&eBuy 1 Level of XP":
        cancel event
        add 1 to player's level
        {@psound}
        subtract 1 * {@xpcost} from the player's account
        close event-player's inventory
    else if event-slot is 5 of {@xpitem} named "&eBuy 5 Levels of XP":
        cancel event
        add 5 to player's level
        {@soundlev}
        subtract 5 * {@xpcost} from the player's account
        close event-player's inventory
    else if event-slot is 10 of {@xpitem} named "&eBuy 10 Levels of XP":
        cancel event
        add 10 to player's level
        {@soundlev}
        close event-player's inventory
        subtract 10 * {@xpcost} from the player's account
    else if event-slot is skull of ("MHF_QUESTION" parsed as an offline player) named "&eBuy a custom amount of XP Levels":
        cancel event
        close event-player's inventory
        open chest inventory with 4 rows named {@confname} to player
        {@psound}
        set slot 0,1,2,3,4,5,6,7,8,9,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34 and 35 of player's current inventory to {@confbckgrnd} named " "
        set slot 11 of player's current inventory to {@remitem} named "&cRemove 1 XP Level"
        set slot 15 of player's current inventory to {@additem} named "&aAdd 1 XP Level"
        set slot 13 of player's current inventory to {currentxpgui.%player%} of {@xpitem} named "&eBuy %{currentxpgui.%player%}% &eXP Levels"
        set slot 31 of player's current inventory to green stained glass pane named "&aConfirm Order"
    else if event-slot is {@additem} named "&aAdd 1 XP Level":
        cancel event
        add 1 to {currentxpgui.%player%}
        set slot 13 of player's current inventory to {currentxpgui.%player%} of {@xpitem} named "&eBuy %{currentxpgui.%player%}% &eXP Levels" with lore "&7Cost: &a$%{currentxpgui.%player%} * {@xpcost}%"
    else if event-slot is {@additem} named "&cRemove 1 XP Level":
        cancel event
        subtract 1 from {currentxpgui.%player%}
        set slot 13 of player's current inventory to {currentxpgui.%player%} of {@xpitem} named "&eBuy %{currentxpgui.%player%}% &eXP Levels" with lore "&7Cost: &a$%{currentxpgui.%player%} * {@xpcost}%"
    else if event-slot is green stained glass pane named "&aConfirm Order":
        cancel event
        remove {currentxpgui.%player%} * {@xpcost} from the player's account
        add {currentxpgui.%player%} to player's level
        close event-player's inventory
        {@soundlev}
        
        
on inventory close:
    if slot 31 of player's current inventory is green stained glass pane named "&aConfirm Order":
        set {currentxpgui.%player%} to 1