Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # SHOPIFY - BOUGHT AND SALE ! #
- #--------------////////////////-------------#
- # #
- # Shopify - it's script to solding or #
- # buying items by signs. #
- # #
- # Dependencies: #
- # - Skript 2.0.2 (or better) #
- # - plugin to economy #
- # iConomy is best :P #
- # #
- # Sign example: #
- # #
- # Line 1: _shopify #
- # Line 2: buy #
- # Line 3: *item #
- # Line 4: *price #
- # #
- # * - you must change it. #
- # #
- # Example: #
- # #
- # Line 1: _shopify #
- # Line 2: buy #
- # Line 3: 2 diamonds #
- # Line 4: 20.00 #
- # #
- # With sales it look's like this ^ #
- # #
- # #
- # Script has been created by: #
- # - krzysek #
- # #
- # ** Sorry for my english :C #
- # but I think you understand greater #
- # part of it. #
- # #
- #--------------////////////////-------------#
- On sign change:
- if line 1 is "_shopify":
- if player has permission "shopify.create":
- if line 2 is "buy":
- set line 1 to "&4&l_&8Shopify"
- set line 2 to "&a&l--BUY--"
- set line 3 to "%coloured line 3%"
- message "&4&l_&8&lShopify &f> &aCreated shop ! (BUY)"
- if line 4 is empty:
- set line 4 to "&a&l-FOR FREE-"
- stop
- else:
- set line 4 to "%coloured line 4% $"
- stop
- else:
- if line 2 is "sell":
- set line 1 to "&4&l_&8Shopify"
- set line 2 to "&6&l--SELL--"
- if line 3 isn't empty:
- set line 3 to "%coloured line 3%"
- if line 4 isn't empty:
- set line 4 to "%coloured line 4% $"
- message "&4&l_&8&lShopify &f> &aCreated shop ! (SELL)"
- stop
- else:
- message "&4&l_&8&lShopify &f> &4&lERROR ! &c&lYou didn't speficy price ! (Line 4)"
- stop
- else:
- message "&4&l_&8&lShopify &f> &4&lERROR ! &c&lYou didn't speficy item ! (Line 3)"
- stop
- else:
- message "&4You don't have permissions to this."
- stop
- On left click on sign:
- if line 1 of clicked block is "&4&l_&8Shopify":
- if line 2 of clicked block is "&a&l--BUY--":
- if player has permission "shopify.buy":
- cancel event
- if line 3 of clicked block is empty:
- message "&4&l_&8&lShopify &f> &4&lERROR ! &c&lLine 3 is empty !"
- stop
- else:
- if line 4 of clicked block is "&a&l-FOR FREE-":
- set {_buy} to "%uncoloured line 3 of clicked block%"
- set {_bu} to "%{_buy}%" parsed as items
- add {_bu} to player's inventory
- message "&4&l_&8&lShopify &f> &aYou bought: %coloured line 3 of clicked block% &afor free !"
- stop
- else:
- set {_price} to "%uncoloured line 4 of clicked block%"
- wait 1 tick
- set {_pric} to "%{_price}%" parsed as money
- set {_buy} to "%uncoloured line 3 of clicked block%"
- set {_bu} to "%{_buy}%" parsed as items
- if player's balance isn't greater than {_pric}:
- message "&4&l_&8&lShopify &f> &4You balance isn't greater than &3%{_price}% $"
- stop
- else:
- wait 1 tick
- replace all "$" with "" in {_price}
- wait 1 tick
- execute console command "money take %player% %{_price}%"
- add {_bu} to player's inventory
- message "&4&l_&8&lShopify &f> &aYou bought &3%{_bu}% &afor &3%{_price}% $"
- stop
- else:
- message "&4You don't have permissions to this."
- stop
- else:
- if line 2 of clicked block is "&6&l--SELL--":
- if player has permission "shopify.sell":
- cancel event
- if line 3 of clicked block is empty:
- message "&4&l_&8&lShopify &f> &4&lERROR ! &c&lLine 3 is empty !"
- stop
- else:
- if line 4 of clicked block is empty:
- message "&4&l_&8&lShopify &f> &4&lERROR ! &c&lLine 4 is empty !"
- stop
- else:
- set {_price} to "%uncoloured line 4 of clicked block%"
- wait 1 tick
- set {_pric} to "%{_price}%" parsed as money
- set {_sell} to "%uncoloured line 3 of clicked block%"
- set {_sel} to "%{_sell}%" parsed as items
- if player don't have {_sel}:
- message "&4&l_&8&lShopify &f> &4You can't sell this item beacouse you don't have it !"
- stop
- else:
- remove {_sel} from player's inventory
- wait 1 tick
- replace all "$" with "" in {_price}
- wait 1 tick
- execute console command "money give %player% %{_price}%"
- message "&4&l_&8&lShopify &f> &aYou sold &3%{_sel}% &afor &3%{_price}% $"
- stop
- else:
- message "&4You don't have permissions to this."
- stop
- Command /shopify [<text>]:
- description: Shopify commands !
- aliases: _shop
- trigger:
- if arg 1 isn't set:
- message "--------------////////////////-------------"
- message "&3 --> &6/shopify remove &f:"
- message "&3 &f- &6Remove sign."
- message "--------------////////////////-------------"
- stop
- else:
- if arg 1 is "remove":
- if player has permission "shopify.remove":
- if target block is sign:
- if line 1 of target block is "&4&l_&8Shopify":
- set target block to air
- message "&4&l_&8&lShopify &f> &aSign has been removed."
- stop
- else:
- message "&4&l_&8&lShopify &f> &4This sign isn't to sell/buy."
- stop
- else:
- message "&4&l_&8&lShopify &f> &4Target block isn't a sign."
- stop
- else:
- message "&4You don't have permissions to this command."
- stop
Advertisement
Add Comment
Please, Sign In to add comment