Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- sgp: stained glass pane named " " with all flags hidden
- function smallText(t: text) :: string:
- set {_chars::*} to split "ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡʏxᴢ:" at ""
- set {_chars1::*} to split "abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWYXZ:" at ""
- loop (size of {_chars::*}) times:
- replace all {_chars::%loop-value%} and {_chars1::%loop-value+26%} in {_t} with {_chars::%loop-value%}
- return {_t}
- function setSlots(I: number, P: player, IT1: item, IT2: item, IT3: item, IT4: item, IT5: item, IT6: item):
- set {_slot} to 9
- if {_I} is 0:
- loop 6 times:
- add 1 to {_slot}
- set slot {_slot} of {_P}'s current inventory to {_IT%loop-value%}
- else:
- loop 3 times:
- add 1 to {_slot}
- set slot {_slot} of {_P}'s current inventory to {_IT%loop-value%}
- add 1 to {_slot}
- set {_lvalue} to 3
- loop 3 times:
- add 1 to {_slot}
- add 1 to {_lvalue}
- set slot {_slot} of {_P}'s current inventory to {_IT%{_lvalue}%}
- function inventory(P: player, T: string):
- open chest inventory with 3 rows named coloured {_T} to {_P}
- set slots 0,1,2,3,4,5,6,7,8,9,13,17,18,19,20,21,22,23,24,25 and 26 of {_P}'s current inventory to black {@sgp}
- function addBlockShop(N: number, I1: item, I2: item, I3: item, I4: item, I5: item, I6: item, C1: number, C2: number, C3: number, C4: number, C5: number, C6: number):
- loop 6 times:
- add 16 of {_I%loop-value%} with lore "&7Cost&f: &2$&a%{_C%loop-value%}%" to {blockshop%{_N}%::*}
- on load:
- delete {blockshop1::*}
- addBlockShop(1, grass block, stone, cobblestone, stone bricks, stone brick slab, stone brick stairs, 150, 150, 150, 150, 150, 150)
- function blockshop(P: player, T: text, S: number):
- open chest inventory with 6 rows named coloured {_T} to {_P}
- set slots (integers between 45 and 53) of {_P}'s current inventory to black {@sgp}
- set slot 50 of {_P}'s current inventory to lime {@sgp} named "&aNext Page &7[&f»&7]" with all flags hidden
- set slot 48 of {_P}'s current inventory to red {@sgp} named "&cPrevious Page &7[&f«&7]" with all flags hidden if {_S} isn't 1
- set slot 48 of {_P}'s current inventory to red {@sgp} named "&cClose" with all flags hidden if {_S} is 1
- set {_slot} to -1
- set {_maxslot} to 45
- loop {_maxslot} times:
- add 1 to {_slot}
- set slot {_slot} of {_P}'s current inventory to {blockshop%{_S}%::%loop-value%} if {blockshop::%loop-value%} is set
- set slot {_slot} of {_P}'s current inventory to gray {@sgp} if {blockshop%{_S}%::%loop-value%} isn't set
- function itemReturn(I: item, N: text, X: text, B: text, Z: text) :: item:
- return {_I} named "%{_Z}%%smallText({_N})%" with lore " ", "&f%smallText({_X})%", "&f%smallText({_B})%", " " and "%{_Z}%➥ %smallText("click to browse")%" with all flags hidden
- function categories(P: player):
- set {_misclist::*} to water bucket and hopper
- set {_ran} to random element out of {_misclist::*}
- inventory({_P}, " <##FB5444>&l%smallText("shop")%")
- setSlots(1, {_P}, itemReturn(grass block, "blocks", "find all of the blocks", "you would need here!", "<##E37939>"), itemReturn(cornflower, "decorations", "find all of the decor", "you would need here!", "<##556CF2>"), itemReturn(red concrete, "colored blocks", "find all of the", "colored blocks here!", "<##52F262>"), itemReturn(hay block, "generators", "purchase your", "generators here!", "<##F2E855>"), itemReturn(blaze rod, "sellwands", "purchase your", "sellwands here!", "<##F25641>"), itemReturn({_ran}, "miscellaneous", "purchase misc", "items here!", "<##E76AFF>"))
- command /bal:
- trigger:
- send {balance::%player's uuid%} to player
- command /setmybal <number>:
- trigger:
- set {balance::%player's uuid%} to arg-1
- on inventory click:
- if name of player's current inventory is " <##E37939>&l%smallText("blocks")%<##c6c6c6>1":
- cancel event
- if clicked inventory isn't player's inventory:
- if event-slot isn't lime {@sgp} or red {@sgp} or black {@sgp} or gray {@sgp}:
- set {_cost} to uncoloured line 1 of lore of event-slot
- replace all "Cost: $" in {_cost} with ""
- set {_cost} to {_cost} parsed as an integer
- if {balance::%player's uuid%} >= {_cost}:
- if player has enough space for a diamond pickaxe:
- remove {_cost} from {balance::%player's uuid%}
- set {_eventslot} to event-slot
- delete lore of {_eventslot}
- give player {_eventslot}
- play sound "minecraft:block.note_block.pling" at pitch 2 to player
- else:
- play sound "minecraft:block.note_block.pling" at pitch 1 to player
- else:
- if event-slot is a red stained glass pane named "&cClose":
- play sound "minecraft:block.note_block.pling" at pitch 2 to player
- categories(player)
- else:
- play sound "minecraft:block.note_block.pling" at pitch 1 to player
- if name of player's current inventory is " <##FB5444>&l%smallText("shop")%":
- cancel event
- play sound "minecraft:block.note_block.pling" at pitch 2 to player
- blockshop(player, " <##E37939>&l%smallText("blocks")%<##c6c6c6>1", 1) if index of event-slot is 10
- command /shop:
- trigger:
- categories(player)
Add Comment
Please, Sign In to add comment