Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &3&lSKYBLOCK
- command /shop [<text>]:
- trigger:
- open virtual chest inventory with size 3 named "&3Shop" for player
- format gui slot 10 of player with grass block named "&7Building Blocks" to run function shop(player, "Building")
- format gui slot 11 of player with redstone dust named "&7Redstone" to run function shop(player, "Redstone")
- format gui slot 12 of player with rotten flesh named "&7Mob Drops" to run function shop(player, "Drops")
- format gui slot 13 of player with wheat named "&7Farming Supplies" to run function shop(player, "Farming")
- format gui slot 14 of player with barrier named "&cComing Soon!"
- format gui slot 15 of player with barrier named "&cComing Soon!"
- function shop(p: player, s: text, page: number=1):
- open virtual chest inventory with size 6 named "&3%{_s}% &7($%convertNum({bal::%{_p}%})%)" for {_p}
- set {_n} to 0
- set {_tPage} to {_page} - 1
- set {_tPage-2} to 45*{_p3}
- set {_uuid} to uuid of {_p2}
- loop {shop::%{_s}%::*}:
- if (loop-index parsed as integer) > {_tPage-2}:
- set {_s::*} to loop-value split at " - "
- set {_i} to "%first element out of {_s::*}%" parsed as item
- set {_van::*} to vanilla name of {_i}
- set {_van} to first element out of {_van::*}
- replace all "minecraft:" in {_van} with ""
- replace all "_" in {_van} with " "
- set {_price} to "%2nd element out of {_s::*}%" parsed as number
- set {_i::*} to ("%{_van}%") split at " "
- loop {_i::*}:
- if {_name} is not set:
- set {_name} to cap(loop-value-2)
- else:
- set {_name} to "%{_name}% %cap(loop-value-2)%"
- format gui slot {_n} of {_p} with {_i} named "&b%{_name}%" lored "&8(&3!&8) &7Price: &b$%convertNum({_price})%" to run function buyitem({_p}, {_i}, {_price}, {_name})
- delete {_name}
- add 1 to {_n}
- if size of {shop::%{_s}%::*} > (27*{_page}):
- format gui slot 26 of {_p} with paper named "&8(&3!&8) &7Next Page" to run:
- shop({_p}, {-s}, {_page} + 1)
- if {_page} > 1:
- format gui slot 18 of {_p} with paper named "&8(&3!&8) &7Previous Page" to run:
- shop({_p}, {-s}, {_page} - 1)
- command /additem [<text>] [<number>]:
- permission: *
- permission message: &cno
- trigger:
- if arg-1 is not set:
- send "{@prefix} &8-- &7Categories: &bBuilding, Redstone, Farming, Drops"
- else if arg-1 is not set:
- send "{@prefix} &8-- &7You need a price... are you okay?"
- else if player's tool is not air:
- if arg-1 is "building" or "farming" or "redstone" or "Drops":
- set {_v} to "%vanilla name of tool%"
- replace all "minecraft:" in {_v} with ""
- replace all "_" in {_v} with " "
- send "{@prefix} &8-- &7Added &b%{_v}% &7to &b%arg-1% &7for &b$%arg-2%&7!"
- add "%player's tool% - %arg-2%" to {shop::%arg-1%::*}
- else:
- send "{@prefix} &8-- &7Invalid category."
- else:
- send "{@prefix} &8-- &7Please hold the item you want to add."
- command /delitem [<text>] [<text>]:
- permission: op
- permission message: &cno
- trigger:
- if arg-1 is not "building" or "farming" or "redstone" or "drops":
- send "{@prefix} &8-- &7Categories: &bBuilding, Redstone, Farming, Drops"
- else if arg-1 is not set:
- send "{@prefix} &8-- &7Choose an item."
- else if {shop::%arg-1%::*} does not contain arg-2:
- send "{@prefix} &8- &7ITEMS IN SHOP:"
- loop {shop::%arg-1%::*}:
- send "&8- &b%loop-value%"
- else:
- remove arg-2 from {shop::%arg-1%::*}
- send "{@prefix} &8- &7Removed the item from shop."
- function buyitem(p: player, i: item, price: number, name: text):
- if {bal::%{_p}%} >= {_price}:
- if {_p} has enough space for {_i}:
- give {_p} {_i}
- subtract {_price} from {bal::%{_p}%}
- send "{@prefix} &8- &7You bought &b%{_name}% &7for &b$%convertNum({_price})%&7!" to {_p}
- else:
- send "{@prefix} &8- &7You don't have enough inventory space!" to {_p}
- else:
- send "{@prefix} &8- &7You're too broke to do that!" to {_p}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement