Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on leftclick:
- if targeted block is wall sign:
- if {McCS.Shops.%location of event-block%} is true:
- if player is not holding any axe:
- if {McCS.Owner.%location of event-block%} is not player:
- if block at location of block below event-block is a chest:
- player has {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
- if the block at location of block below event-block can hold {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
- if {myc.%{McCS.Owner.%location of event-block%}%.money} is greater or equal to {McCS.PriceSell.%location of event-block%}:
- if player has permission "McCS.Shop.Buy":
- execute op command "/myc-transaction normal MyConomy_ChestShops %{McCS.Owner.%location of event-block%}% %player% %{McCS.PriceSell.%location of event-block%}%"
- if {myc.%player%.tcomplete} is true:
- set {myc.%player%.tcomplete} to false
- add {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} to the block at location of block below event-block
- remove {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} from player
- log "[Chest Shop]: %player% was paid %{McCS.PriceBuy.%location of event-block%}% for selling %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%." to "myc/%{McCS.Owner.%location of event-block%}%"
- log "[Chest Shop]: %player% was paid %{McCS.PriceBuy.%location of event-block%}% for selling %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%" to "myc/%player%"
- if {McCS.PriceSell.%location of event-block%} is greater than 1:
- message "&6[&eMyC&6]&e: %{McCS.PriceSell.%location of event-block%}% %{myc.currency.plural}% were added to your account!"
- message "%{McCS.Prefix}%&f: %{McCS.ShopSellSucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}% for %{McCS.PriceSell.%location of event-block%}% %{myc.currency.plural}%!"
- else:
- message "&6[&eMyC&6]&e: %{McCS.PriceSell.%location of event-block%}% %{myc.currency}% was added to your account!"
- message "%{McCS.Prefix}%&f: %{McCS.ShopSellSucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% to %{McCS.Owner.%location of event-block%}% for %{McCS.PriceSell.%location of event-block%}% %{myc.currency}%!"
- cancel the event
- else:
- message "%{McCS.Prefix}%&f: Transaction failed. Please try again."
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorPermissionShopBuy}%"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.BuyerNotEnoughMoney}%"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorShopCantFit}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}%!"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorFewItems}% %{McCS.ItemType.%location of event-block%}%!"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorShopChestGone}%"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorBuyOwnShop}%"
- cancel the event
- exit
- on rightclick:
- if targeted block is wall sign:
- if {McCS.Shops.%location of event-block%} is true:
- if player is not sneaking:
- if {McCS.Owner.%location of event-block%} is not player:
- if block at location of block below event-block is a chest:
- if the block at location of block below event-block contains {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
- if the player can hold {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%}:
- if {myc.%player%.money} is greater or equal to {McCS.PriceBuy.%location of event-block%}:
- if player has permission "McCS.Shop.Sell":
- execute op command "/myc-transaction normal MyConomy_ChestShops %player% %{McCS.Owner.%location of event-block%}% %{McCS.PriceBuy.%location of event-block%}%"
- if {myc.%player%.tcomplete} is true:
- set {myc.%player%.tcomplete} to false
- remove {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} from the block at location of block below event-block
- give {McCS.ItemCount.%location of event-block%} of {McCS.ItemType.%location of event-block%} to the player
- log "[Chest Shop]: %player% paid %{McCS.PriceBuy.%location of event-block%}% while buying %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%." to "myc/%{McCS.Owner.%location of event-block%}%"
- log "[Chest Shop]: %player% paid %{McCS.PriceBuy.%location of event-block%}% while buying %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}%'s chest shop at %location of event-block%." to "myc/%player%"
- if {McCS.PriceBuy.%location of event-block%} is greater than 1:
- message "&6[&eMyC&6]&e: %{McCS.PriceBuy.%location of event-block%}% %{myc.currency.plural}% were removed from your account!"
- message "%{McCS.Prefix}%&f: %{McCS.ShopBuySucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}% for %{McCS.PriceBuy.%location of event-block%}% %{myc.currency.plural}%!"
- else:
- message "&6[&eMyC&6]&e: %{McCS.PriceBuy.%location of event-block%}% %{myc.currency}% was removed from your account!"
- message "%{McCS.Prefix}%&f: %{McCS.ShopBuySucessful}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}% from %{McCS.Owner.%location of event-block%}% for %{McCS.PriceBuy.%location of event-block%}% %{myc.currency}%!"
- cancel the event
- else:
- message "%{McCS.Prefix}%&f: Transaction failed. Please try again."
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorPermissionShopSell}%"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.SellerNotEnoughMoney}%"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorPlayerCantFit}% %{McCS.ItemCount.%location of event-block%}% %{McCS.ItemType.%location of event-block%}%!"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorShopFewItems}% %{McCS.ItemType.%location of event-block%}%!"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorShopChestGone}%"
- cancel the event
- exit
- else:
- message "%{McCS.Prefix}%&f: %{McCS.ErrorSellOwnShop}%"
- cancel the event
- exit
Advertisement
Add Comment
Please, Sign In to add comment