Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- SellWandPrefix: &b&lSELL WAND &8»
- on load:
- set {sell:wand::name} to "&3→ &b&lSell-Wand &3←"
- delete {sell::item::*}
- set {sell::item::wheat} to wheat item
- set {sell::item::cactus} to cactus
- set {sell::item::sugarcane} to sugar cane
- set {sell::item::carrot} to carrot
- set {sell::item::wheat_seed} to wheat seed
- set {sell::item::pumpkin} to pumpkin
- set {sell::item::coal} to coal
- set {sell::item::iron} to iron ingot
- set {sell::item::gold} to gold ingot
- set {sell::item::lapis} to lapis
- set {sell::item::redstone} to redstone
- set {sell::item::glowstone} to glowstone dust
- set {sell::item::diamond} to diamond
- set {sell::item::quartz} to nether quartz
- set {sell::item::emerald} to emerald
- delete {sell::price::*}
- set {sell::price::wheat} to 20
- set {sell::price::wheat_seed} to 5
- set {sell::price::cactus} to 20
- set {sell::price::sugarcane} to 20
- set {sell::price::carrot} to 10
- set {sell::price::pumpkin} to 20
- set {sell::price::coal} to 15
- set {sell::price::iron} to 15
- set {sell::price::gold} to 90
- set {sell::price::lapis} to 20
- set {sell::price::redstone} to 25
- set {sell::price::glowstone} to 32
- set {sell::price::diamond} to 150
- set {sell::price::quartz} to 35
- set {sell::price::emerald} to 100
- command /sellwand [<player>] [<integer>]:
- permission: skript.sellwand
- trigger:
- give arg-1 1 golden axe named "%{sell:wand::name}% (%arg-2%)" lored "&7Usage: &cRight-click on a chest to sell the items inside (made by xlr100)"
- on right click on chest or trapped chest or hopper with a golden axe:
- set {_name} to name of player's tool
- if {_name} contains "%{sell:wand::name}%":
- cancel event
- loop all items in inventory of clicked block:
- set {_item} to loop-value
- set {_item} to regex replace "[0-9]" with "" in "%{_item}%"
- replace all " items" and " item" in {_item} with ""
- set {_item} to {_item} parsed as itemtype
- if {sell::item::*} contains {_item}:
- set {_amount} to amount of {_item} in inventory of clicked block
- set {_amount} to {_amount} parsed as integer
- remove all {_item} from inventory of clicked block
- loop {sell::price::*}:
- if "%{sell::item::%loop-index%}%" = "%{_item}%":
- set {_price} to loop-value-2
- stop loop
- set {_money} to {_amount} * {_price}
- set {_m} to regex replace "(?<=\d)(?=(\d{3})+(?!\d))" with "," in "%{_money}%"
- add {_money} to {_total}
- set {_i} to "%{_item}%"
- replace all " items" and " item" in {_i} with ""
- send colored "{@SellWandPrefix} &7Sold %{_amount}% %{_i}% for %{_m}%$"
- if {_total} > 0:
- set {_t} to regex replace "(?<=\d)(?=(\d{3})+(?!\d))" with "," in "%{_total}%"
- add {_total} to player's balance
- send colored "{@SellWandPrefix} &aYou have recieved a total of %{_t}%$"
- set {_uses} to uncolored {_name}
- replace all "%uncolored {sell:wand::name}% (" and ")" in {_uses} with ""
- set {_uses} to {_uses} parsed as integer
- if {_uses} > 1:
- remove 1 from {_uses}
- set name of player's tool to "%{sell:wand::name}% (%{_uses}%)"
- else:
- send "{@SellWandPrefix} &cYour sell wand broke!"
- loop all items in player's inventory:
- name of loop-item contains "%{sell:wand::name}%"
- name of loop-item contains "(1)"
- wait 1 tick
- delete loop-item
- stop
- else:
- send colored "{@SellWandPrefix} &cThere are no sellable items in this inventory"
- on join:
- set join message to "&8[&2&l+&8] &a%player%"
- on quit:
- set quit message to "&8[&4&l-&8] &c%player%"
- on first join:
- add 1 to {uj}
- broadcast "
- &7[&e&lFrag&6&lblock&7] &8&l- &e%player%&7, Welcome to the server, &8(&e##%{uj}%&8)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement