Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ----------------------------- Tuske's Main ShopGui -----------------------------------
- on skript load:
- ShopGui()
- function ShopGui():
- set {_shape::1} to "1xxxxxxx1"
- set {_shape::2} to "2xAxBxCx2"
- set {_shape::3} to "1xxExFxx1"
- set {_shape::4} to "2xGxHxIx2"
- set {_shape::5} to "1xxxxxxx1"
- create a gui with id "&8Skyblock Shop" with virtual chest with 5 rows named "&8Skyblock Shop" and shape {_shape::*}:
- make gui "1" with white stained glass pane named "&7"
- make gui "2" with yellow stained glass pane named "&7"
- make gui "A" with grass named "&a&lBuilding Blocks" with lore "&7Click to open up this category":
- open gui "&8Building Blocks" to player
- make gui "I" with white wool block named "&f&lColored Blocks" with lore "&7Click to open up this category":
- open gui "&8Colored Blocks" to player
- make gui "G" with sunflower named "&e&lDecoration" with lore "&7Click to open up this category":
- open gui "&8Decoration" to player
- make gui "B" with wheat item named "&6&lFarming and Food" with lore "&7Click to open up this category":
- open gui "&8Farming and Food" to player
- make gui "H" with creeper head named "&2&lMiscellaneous" with lore "&7Click to open up this category":
- open gui "&8Miscellaneous" to player
- make gui "F" with redstone named "&c&lRedstone and Redstone Items" with lore "&7Click to open up this category":
- open gui "&8Redstone and Redstone Items" to player
- make gui "E" with iron ingot named "&7&lOres and Valuables" with lore "&7Click to open up this category":
- open gui "&8Ores and Valuables" to player
- make gui "C" with bone named "&d&lMob Drops" with lore "&7Click to open up this category":
- open gui "&8Mob Drops" to player
- create a gui with id "&8Redstone and Redstone Items" with virtual chest with 2 rows named "&8Redstone and Redstone Items":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, redstone, 1500, 375)
- slot(last gui, redstone block, 13500, 3375)
- slot(last gui, redstone repeater, 5440, 1360)
- slot(last gui, redstone comparator item, 70400, 17600)
- slot(last gui, redstone lamp, 70400, 17600)
- slot(last gui, hopper, 51500, 12800)
- slot(last gui, dropper, 6400, 1600)
- slot(last gui, dispenser, 9600, 2400)
- slot(last gui, normal piston, 25600, 0)
- slot(last gui, sticky piston, 64000, 0)
- slot(last gui, nether quartz, 32000, 8000)
- create a gui with id "&8Ores and Valuables" with virtual chest with 2 rows named "&8Ores and Valuables":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, coal, 1000, 250)
- slot(last gui, coal block, 9000, 2250)
- slot(last gui, iron ingot, 9600, 1920)
- slot(last gui, iron block, 86400, 21600)
- slot(last gui, gold nugget, 1600, 400)
- slot(last gui, gold ingot, 14400, 3600)
- slot(last gui, gold block, 129600, 32400)
- slot(last gui, diamond, 96000, 19200)
- slot(last gui, diamond block, 864000, 216000)
- slot(last gui, emerald, 128000, 25600)
- slot(last gui, emerald block, 1152000, 288000)
- create a gui with id "&8Farming and Food" with virtual chest with 4 rows named "&8Farming and Food":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, oak sapling, 19200, 4800)
- slot(last gui, spruce sapling, 19200, 4800)
- slot(last gui, birch sapling, 19200, 4800)
- slot(last gui, jungle sapling, 19200, 4800)
- slot(last gui, acacia sapling, 19200, 4800)
- slot(last gui, dark oak sapling, 19200, 4800)
- slot(last gui, seeds, 1920, 320)
- slot(last gui, wheat, 1000, 500)
- slot(last gui, hay block, 14400, 3600)
- slot(last gui, potato, 1200, 300)
- slot(last gui, poisonous potato, 6400, 1600)
- slot(last gui, nether wart item, 2200, 700)
- slot(last gui, soul sand, 640000, 3200)
- slot(last gui, pumpkin seeds, 19200, 2400)
- slot(last gui, pumpkin, 76800, 9600)
- slot(last gui, melon seeds, 10, 2.5)
- slot(last gui, melon slice, 640, 160)
- slot(last gui, melon block, 5760, 1440)
- slot(last gui, carrot item, 1200, 300)
- slot(last gui, sugar canes, 1200, 300)
- slot(last gui, cactus, 25000, 5000)
- slot(last gui, brown dye, 3200, 800)
- slot(last gui, brown mushroom, 1200, 300)
- slot(last gui, red mushroom, 1200, 300)
- slot(last gui, apple, 3200, 800)
- slot(last gui, bread, 3200, 800)
- slot(last gui, baked potato, 1200, 300)
- slot(last gui, cooked porkchop, 1200, 300)
- slot(last gui, steak, 1200, 300)
- slot(last gui, cooked cod fillet, 28800, 7200)
- slot(last gui, cooked chicken, 1200, 300)
- slot(last gui, cooked rabbit, 1500, 375)
- slot(last gui, cooked mutton, 1500, 375)
- create a gui with id "&8Building Blocks" with virtual chest with 6 rows named "&8Building Blocks":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, stone, 0, 0)
- slot(last gui, cobblestone, 0, 0)
- slot(last gui, mossy cobble block, 0, 0)
- slot(last gui, stone bricks, 0, 0)
- slot(last gui, mossy stone brick, 0, 0)
- slot(last gui, cracked stone brick, 0, 0)
- slot(last gui, red brick block, 0, 0)
- slot(last gui, granite, 0, 0)
- slot(last gui, diorite, 0, 0)
- slot(last gui, andesite, 0, 0)
- slot(last gui, gravel, 0, 0)
- slot(last gui, sand, 0, 0)
- slot(last gui, sandstone, 0, 0)
- slot(last gui, chiseled sandstone, 0, 0)
- slot(last gui, smooth sandstone, 0, 0)
- slot(last gui, lapis lazuli block, 0, 0)
- slot(last gui, obsidian, 0, 0)
- slot(last gui, red sand, 0, 0)
- slot(last gui, snow block, 0, 0)
- slot(last gui, packed ice, 0, 0)
- slot(last gui, quartz block, 0, 0)
- slot(last gui, chiseled quartz, 0, 0)
- slot(last gui, quartz pillar, 0, 0)
- slot(last gui, red brick block, 0, 0)
- slot(last gui, netherrack, 0, 0)
- slot(last gui, nether brick block, 0, 0)
- slot(last gui, oak wood planks, 0, 0)
- slot(last gui, spruce wood planks, 0, 0)
- slot(last gui, birch wood planks, 0, 0)
- slot(last gui, jungle wood planks, 0, 0)
- slot(last gui, acacia wood planks, 0, 0)
- slot(last gui, dark oak wood planks, 0, 0)
- slot(last gui, oak log, 0, 0)
- slot(last gui, spruce log, 0, 0)
- slot(last gui, birch log, 0, 0)
- slot(last gui, jungle log, 0, 0)
- slot(last gui, acacia log, 0, 0)
- slot(last gui, dark oak log, 0, 0)
- slot(last gui, end stone, 0, 0)
- slot(last gui, clay block, 0, 0)
- slot(last gui, plain glass block, 0, 0)
- slot(last gui, ice block, 0, 0)
- slot(last gui, dirt, 0, 0)
- slot(last gui, grass, 0, 0)
- slot(last gui, podzol, 0, 0)
- slot(last gui, mycelium, 0, 0)
- slot(last gui, coarse dirt, 0, 0)
- slot(last gui, prismarine, 0, 0)
- slot(last gui, prismarine bricks, 0, 0)
- slot(last gui, dark prismarine, 0, 0)
- slot(last gui, sea lantern, 0, 0)
- slot(last gui, red sandstone, 0, 0)
- slot(last gui, red chiseled sandstone, 0, 0)
- slot(last gui, smooth red sandstone, 0, 0)
- create a gui with id "&8Colored Blocks" with virtual chest with 6 rows named "&8Colored Blocks":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, white wool block, 960, 240)
- slot(last gui, orange wool block, 960, 240)
- slot(last gui, magenta wool block, 960, 240)
- slot(last gui, light blue wool block, 960, 240)
- slot(last gui, yellow wool block, 960, 240)
- slot(last gui, green wool block, 960, 240)
- slot(last gui, pink wool block, 960, 240)
- slot(last gui, gray wool block, 960, 240)
- slot(last gui, light gray wool block, 960, 240)
- slot(last gui, cyan wool block, 960, 240)
- slot(last gui, purple wool block, 960, 240)
- slot(last gui, blue wool block, 960, 240)
- slot(last gui, brown wool block, 960, 240)
- slot(last gui, green wool block, 960, 240)
- slot(last gui, red wool block, 960, 240)
- slot(last gui, black wool block, 960, 240)
- slot(last gui, white glass block, 960, 240)
- slot(last gui, orange glass block, 960, 240)
- slot(last gui, magenta glass block, 960, 240)
- slot(last gui, light blue glass block, 960, 240)
- slot(last gui, yellow glass block, 960, 240)
- slot(last gui, green glass block, 960, 240)
- slot(last gui, pink glass block, 960, 240)
- slot(last gui, gray glass block, 960, 240)
- slot(last gui, light gray glass block, 960, 240)
- slot(last gui, cyan glass block, 960, 240)
- slot(last gui, purple glass block, 960, 240)
- slot(last gui, blue glass block, 960, 240)
- slot(last gui, brown glass block, 960, 240)
- slot(last gui, green glass block, 960, 240)
- slot(last gui, red glass block, 960, 240)
- slot(last gui, black glass block, 960, 240)
- slot(last gui, white terracotta, 960, 240)
- slot(last gui, orange terracotta, 960, 240)
- slot(last gui, magenta terracotta, 960, 240)
- slot(last gui, light blue terracotta, 960, 240)
- slot(last gui, yellow terracotta, 960, 240)
- slot(last gui, green terracotta, 960, 240)
- slot(last gui, pink terracotta, 960, 240)
- slot(last gui, gray terracotta, 960, 240)
- slot(last gui, light gray terracotta, 960, 240)
- slot(last gui, cyan terracotta, 960, 240)
- slot(last gui, purple terracotta, 960, 240)
- slot(last gui, blue terracotta, 960, 240)
- slot(last gui, brown terracotta, 960, 240)
- slot(last gui, green terracotta, 960, 240)
- slot(last gui, red terracotta, 960, 240)
- slot(last gui, black terracotta, 960, 240)
- create a gui with id "&8Decoration" with virtual chest with 5 rows named "&8Decorations":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, glowstone, 0, 0)
- slot(last gui, slime block, 0, 0)
- slot(last gui, bookshelf, 0, 0)
- slot(last gui, note block, 0, 0)
- slot(last gui, fern, 0, 0)
- slot(last gui, dead bush, 0, 0)
- slot(last gui, iron bar, 0, 0)
- slot(last gui, poppy, 0, 0)
- slot(last gui, sunflower, 0, 0)
- slot(last gui, lilac, 0, 0)
- slot(last gui, rose bush, 0, 0)
- slot(last gui, peony, 0, 0)
- slot(last gui, white standing banner, 0, 0)
- slot(last gui, orange standing banner, 0, 0)
- slot(last gui, magenta standing banner, 0, 0)
- slot(last gui, light blue standing banner, 0, 0)
- slot(last gui, yellow standing banner, 0, 0)
- slot(last gui, green standing banner, 0, 0)
- slot(last gui, pink standing banner, 0, 0)
- slot(last gui, gray standing banner, 0, 0)
- slot(last gui, light gray standing banner, 0, 0)
- slot(last gui, cyan standing banner, 0, 0)
- slot(last gui, purple standing banner, 0, 0)
- slot(last gui, blue standing banner, 0, 0)
- slot(last gui, brown standing banner, 0, 0)
- slot(last gui, green standing banner, 0, 0)
- slot(last gui, red standing banner, 0, 0)
- slot(last gui, black standing banner, 0, 0)
- slot(last gui, blue orchid, 0, 0)
- slot(last gui, allium, 0, 0)
- slot(last gui, azure bluet, 0, 0)
- slot(last gui, red tulip, 0, 0)
- slot(last gui, orange tulip, 0, 0)
- slot(last gui, white tulip, 0, 0)
- slot(last gui, pink tulip, 0, 0)
- slot(last gui, oxeye daisy, 0, 0)
- slot(last gui, flower pot, 0, 0)
- create a gui with id "&8Mob Drops" with virtual chest with 3 rows named "&8Mob Drops":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, arrow, 750, 187.5)
- slot(last gui, bone, 600, 150)
- slot(last gui, blaze rod, 1200, 300)
- slot(last gui, slimeball, 600, 150)
- slot(last gui, ink sac, 320, 80)
- slot(last gui, string, 500, 125)
- slot(last gui, spider eye, 2400, 600)
- slot(last gui, gunpowder, 5600, 1400)
- slot(last gui, ender pearl, 6000, 1500)
- slot(last gui, rotten flesh, 200, 50)
- slot(last gui, beef, 900, 225)
- slot(last gui, leather, 700, 175)
- slot(last gui, chicken, 900, 225)
- slot(last gui, feather, 400, 100)
- slot(last gui, egg, 250, 62.5)
- slot(last gui, porkchop, 1000, 250)
- slot(last gui, mutton, 1000, 250)
- slot(last gui, rabbit, 1000, 250)
- slot(last gui, rabbit hide, 1200, 300)
- slot(last gui, rabbit foot, 51200, 12800)
- create a gui with id "&8Miscellaneous" with virtual chest with 1 rows named "&8Miscellaneous":
- run when close the gui:
- wait 1 tick
- open gui "&8Skyblock Shop" to gui-player
- slot(last gui, enchantment table, 192000, 48000)
- slot(last gui, chest, 9600, 2400)
- slot(last gui, trapped chest, 9600, 2400)
- slot(last gui, flint, 0, 0)
- slot(last gui, water bucket, 7200, 1800)
- slot(last gui, lava bucket, 24000, 6000)
- slot(last gui, name tag, 16000000, 400000)
- slot(last gui, brewing stand, 1280, 320)
- slot(last gui, ghast tear, 28800, 1280)
- # ----------------------------- Functions -----------------------------------
- function slot(gui: guiinventory, item: item, buy: number, sell: number):
- set {shop::items::%{_item}%} to {_item}
- set {shop::buy::%{_item}%} to {_buy}
- set {shop::sell::%{_item}%} to {_sell}
- set {_stacksize} to max stacksize of {_item}
- set {_buylore} to ({_buy}/{_stacksize})
- set {_selllore} to ({_sell}/{_stacksize})
- edit {_gui}:
- make next gui with {_item} named "&e%{_item}.getI18NDisplayName()%" with lore "", " &2&l* &aBuy &f$%spaced {_buylore}%", " &4&l* &cSell &f$%spaced {_selllore}%", "", "&7** Tip: &fLeft-Click&7 to buy &7&none&7! **" and "&7** Tip: &fShift-Click&7 to buy a &7&nstack&7! **":
- item(type of clicked item, "%clicked type%", gui-player)
- function item(item: item, ct: string, p: player):
- #buy 1 stack
- set {_stacksize} to max stacksize of {_item}
- if {_ct} is "left mouse button with shift":
- broadcast "%{_stacksize}%"
- if {_item} is not air:
- if balance of {_p} >= {shop::buy::%{_item}%}:
- if {_p} has enough space for {_stacksize} of {_item}:
- give {_p} {_stacksize} of type of {_item}
- remove {shop::buy::%{_item}%} from balance of {_p}
- set {_buy} to spaced {shop::buy::%{_item}%}
- send "&e&lSHOP &8⎜ &fYou bought &e%{_stacksize}% x %{_item}.getI18NDisplayName()% &ffor &6$%{_buy}%&f!" to {_p}
- else:
- send "&e&lSHOP &8⎜ &fYour inventory is full!" to {_p}
- else:
- send "&e&lSHOP &8⎜ &fYou don't have enough money!" to {_p}
- #buy 1 item
- else:
- if {_item} is not air:
- if balance of {_p} >= {shop::buy::%{_item}%}/{_stacksize}:
- if {_p} has enough space for 1 of {_item}:
- give {_p} 1 of type of {_item}
- remove {shop::buy::%{_item}%}/{_stacksize} from balance of {_p}
- set {_buy} to ({shop::buy::%{_item}%}/64)
- set {_buy} to spaced {_buy}
- send "&e&lSHOP &8⎜ &fYou bought &e1 x %{_item}.getI18NDisplayName()% &ffor &6$%{_buy}%&f!" to {_p}
- else:
- send "&e&lSHOP &8⎜ &fYour inventory is full!" to {_p}
- else:
- send "&e&lSHOP &8⎜ &fYou don't have enough money!" to {_p}
- else:
- stop
- # ----------------------------- Commands -----------------------------------
- command /shop:
- trigger:
- open gui "&8Skyblock Shop" to player
- command /sell [<text>]:
- trigger:
- if arg 1 is "all":
- set {_amount} and {_itemAmount} to 0
- loop {shop::items::*}:
- set {_item} to "%loop-value%" parsed as item
- set {_inventory::*} to type of items of inventory of {_chest}
- set {_stacksize} to max stacksize of {_item}
- set {_price} to {shop::sell::%{_item}%}/{_stacksize}
- loop all items in inventory of player:
- loop-item is {_item}
- add {_price} * item amount of loop-item to player's balance
- add {_price} * item amount of loop-item to {_amount}
- add item amount of loop-item to {_itemAmount}
- remove loop-item from inventory of player
- if {_itemAmount} is not 0:
- send "&e&lSHOP &8⎜ &fSold all &e%{_itemAmount}% &fitems for a total of &6$%spaced {_amount}%&f!"
- else:
- send "&e&lSHOP &8⎜ &fThere's currently nothing you can sell!"
- else:
- set {_item} to type of player's held item
- set {_sell} to {shop::sell::%{_item}%}/{_stacksize}
- if {_item} is air:
- send "&e&lSHOP &8⎜ &fYou can't sell your &e&oactuel &fhand!"
- stop
- if {_item} is a monster spawner:
- send "&e&lSHOP &8⎜ &fThis item isn't sellable!"
- stop
- else if {_sell} is 0:
- send "&e&lSHOP &8⎜ &fThis item isn't sellable!"
- stop
- else if {_sell} is not set:
- send "&e&lSHOP &8⎜ &fThis item isn't sellable!"
- else:
- set {_amount} to "%player's held item%"
- set {_amount::*} to {_amount} split at " "
- if "%{_amount::1}%" is "%{_item}%":
- add {_sell} to balance of player
- set {_price} to spaced {_sell}
- send "&e&lSHOP &8⎜ &fYou sold &e1x %{_item}.getI18NDisplayName()% &ffor &6$%{_price}%&f!"
- remove 1 of tool from tool
- else:
- set {_amount::1} to "%{_amount::1}%" parsed as a number
- set {_price} to ({_sell} * {_amount::1})
- add {_price} to balance of player
- set {_price} to spaced {_price}
- send "&e&lSHOP &8⎜ &fYou sold &e%{_amount::1}%x %{_item}.getI18NDisplayName()% &ffor &6$%{_price}%&f!"
- remove {_amount::1} of tool from tool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement