Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shop(p: player, g: text, item: object, buyprice: number = 0, name: text = "", flags: text = ""):
- set {_puuid} to uuid of {_p}
- set {_itemname} to "%{_item}%" in upper case
- set {_name} to {_name} in upper case
- set {_buyprice1} to ({_buyprice} * 1)
- set {_buyprice32} to ({_buyprice} * 32)
- edit gui "%{_g}%":
- if {_name} is "":
- if {_flags} is "":
- make next gui slot with 1 of {_item} with name "&f&l%{_itemname}%" with lore "&9Shop Item", "", "&7Buy x1: &2%{_buyprice1}%&2 L-Bucks", "&7Buy x32: &2%{_buyprice32}%&2 L-Bucks &8(Shift Click)", "", and "&eClick Here to Purchase Item!":
- if "%click type%" contains "shift":
- if {%{_puuid}%.bal} >= {_buyprice32}:
- set {_buyamount} to 32
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice32} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchease that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- if {%{_puuid}%.bal} >= {_buyprice1}:
- set {_buyamount} to 1
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice1} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchase that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- make next gui slot with 1 of {_item} with nbt "%{_flags}%" with name "&f&l%{_itemname}%" with lore "&9Shop Item", "", "&7Buy x1: &2%{_buyprice1}%&2 L-Bucks", "&7Buy x32: &2%{_buyprice32}%&2 L-Bucks &8(Shift Click)", "", and "&eClick Here to Purchase Item!":
- if "%click type%" contains "shift":
- if {%{_puuid}%.bal} >= {_buyprice32}:
- set {_buyamount} to 32
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice32} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchease that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- if {%{_puuid}%.bal} >= {_buyprice1}:
- set {_buyamount} to 1
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice1} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchase that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- if {_flags} is "":
- make next gui slot with 1 of {_item} with name "&f&l%{_name}%" with lore "&9Shop Item", "", "&7Buy x1: &2%{_buyprice1}%&2 L-Bucks", "&7Buy x32: &2%{_buyprice32}%&2 L-Bucks &8(Shift Click)", "", and "&eClick Here to Purchase Item!":
- if "%click type%" contains "shift":
- if {%{_puuid}%.bal} >= {_buyprice32}:
- set {_buyamount} to 32
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice32} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchease that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- if {%{_puuid}%.bal} >= {_buyprice1}:
- set {_buyamount} to 1
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice1} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchase that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- make next gui slot with 1 of {_item} with nbt "%{_flags}%" with name "&f&l%{_name}%" with lore "&9Shop Item", "", "&7Buy x1: &2%{_buyprice1}%&2 L-Bucks", "&7Buy x32: &2%{_buyprice32}%&2 L-Bucks &8(Shift Click)", "", and "&eClick Here to Purchase Item!":
- if "%click type%" contains "shift":
- if {%{_puuid}%.bal} >= {_buyprice32}:
- set {_buyamount} to 32
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice32} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchease that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
- else:
- if {%{_puuid}%.bal} >= {_buyprice1}:
- set {_buyamount} to 1
- give {_buyamount} of {_item} to {_p}
- remove {_buyprice1} from {%{_puuid}%.bal}
- send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
- playSound("block.note_block.pling", {_p}, 2)
- else:
- send actionbar "&cYou can not afford to purchase that!" to {_p}
- playSound("entity.item.break", {_p}, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement