Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function shop(p: player, g: text, item: object, buyprice: number = 0, name: text = "", flags: text = ""):
  2.     set {_puuid} to uuid of {_p}
  3.     set {_itemname} to "%{_item}%" in upper case
  4.     set {_name} to {_name} in upper case
  5.     set {_buyprice1} to ({_buyprice} * 1)
  6.     set {_buyprice32} to ({_buyprice}  * 32)
  7.     edit gui "%{_g}%":
  8.         if {_name} is "":
  9.             if {_flags} is "":
  10.                 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!":
  11.                     if "%click type%" contains "shift":
  12.                         if {%{_puuid}%.bal} >= {_buyprice32}:
  13.                             set {_buyamount} to 32
  14.                             give {_buyamount} of {_item} to {_p}
  15.                             remove {_buyprice32} from {%{_puuid}%.bal}
  16.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
  17.                             playSound("block.note_block.pling", {_p}, 2)
  18.                         else:
  19.                             send actionbar "&cYou can not afford to purchease that!" to {_p}
  20.                             playSound("entity.item.break", {_p}, 0)
  21.                     else:
  22.                         if {%{_puuid}%.bal} >= {_buyprice1}:
  23.                             set {_buyamount} to 1
  24.                             give {_buyamount} of {_item} to {_p}
  25.                             remove {_buyprice1} from {%{_puuid}%.bal}
  26.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
  27.                             playSound("block.note_block.pling", {_p}, 2)
  28.                         else:
  29.                             send actionbar "&cYou can not afford to purchase that!" to {_p}
  30.                             playSound("entity.item.break", {_p}, 0)
  31.             else:
  32.                 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!":
  33.                     if "%click type%" contains "shift":
  34.                         if {%{_puuid}%.bal} >= {_buyprice32}:
  35.                             set {_buyamount} to 32
  36.                             give {_buyamount} of {_item} to {_p}
  37.                             remove {_buyprice32} from {%{_puuid}%.bal}
  38.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
  39.                             playSound("block.note_block.pling", {_p}, 2)
  40.                         else:
  41.                             send actionbar "&cYou can not afford to purchease that!" to {_p}
  42.                             playSound("entity.item.break", {_p}, 0)
  43.                     else:
  44.                         if {%{_puuid}%.bal} >= {_buyprice1}:
  45.                             set {_buyamount} to 1
  46.                             give {_buyamount} of {_item} to {_p}
  47.                             remove {_buyprice1} from {%{_puuid}%.bal}
  48.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_itemname}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
  49.                             playSound("block.note_block.pling", {_p}, 2)
  50.                         else:
  51.                             send actionbar "&cYou can not afford to purchase that!" to {_p}
  52.                             playSound("entity.item.break", {_p}, 0)
  53.         else:
  54.             if {_flags} is "":
  55.                 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!":
  56.                     if "%click type%" contains "shift":
  57.                         if {%{_puuid}%.bal} >= {_buyprice32}:
  58.                             set {_buyamount} to 32
  59.                             give {_buyamount} of {_item} to {_p}
  60.                             remove {_buyprice32} from {%{_puuid}%.bal}
  61.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
  62.                             playSound("block.note_block.pling", {_p}, 2)
  63.                         else:
  64.                             send actionbar "&cYou can not afford to purchease that!" to {_p}
  65.                             playSound("entity.item.break", {_p}, 0)
  66.                     else:
  67.                         if {%{_puuid}%.bal} >= {_buyprice1}:
  68.                             set {_buyamount} to 1
  69.                             give {_buyamount} of {_item} to {_p}
  70.                             remove {_buyprice1} from {%{_puuid}%.bal}
  71.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
  72.                             playSound("block.note_block.pling", {_p}, 2)
  73.                         else:
  74.                             send actionbar "&cYou can not afford to purchase that!" to {_p}
  75.                             playSound("entity.item.break", {_p}, 0)
  76.             else:
  77.                 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!":
  78.                     if "%click type%" contains "shift":
  79.                         if {%{_puuid}%.bal} >= {_buyprice32}:
  80.                             set {_buyamount} to 32
  81.                             give {_buyamount} of {_item} to {_p}
  82.                             remove {_buyprice32} from {%{_puuid}%.bal}
  83.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice32}%&2 L-Bucks" to {_p}
  84.                             playSound("block.note_block.pling", {_p}, 2)
  85.                         else:
  86.                             send actionbar "&cYou can not afford to purchease that!" to {_p}
  87.                             playSound("entity.item.break", {_p}, 0)
  88.                     else:
  89.                         if {%{_puuid}%.bal} >= {_buyprice1}:
  90.                             set {_buyamount} to 1
  91.                             give {_buyamount} of {_item} to {_p}
  92.                             remove {_buyprice1} from {%{_puuid}%.bal}
  93.                             send actionbar "&7Purchased &rx%{_buyamount}%&r %{_name}%&7 for &2%{_buyprice1}%&2 L-Bucks" to {_p}
  94.                             playSound("block.note_block.pling", {_p}, 2)
  95.                         else:
  96.                             send actionbar "&cYou can not afford to purchase that!" to {_p}
  97.                             playSound("entity.item.break", {_p}, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement