Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mainShop(p: player):
- set {_inv} to chest inventory with 3 rows named "&5&lShop"
- set slot (integers from 0 to 8) of {_inv} to gray glass pane
- set slot 9 and 17 of {_inv} to gray glass pane
- set slot (integers from 18 to 26) of {_inv} to gray glass pane
- set slot 10 of {_inv} to grass block named "&a&lBlocks"
- set slot 11 of {_inv} to redstone block named "&4&lRedstone"
- set slot 12 of {_inv} to heart of the sea named "&b&lMisc"
- set slot 14 of {_inv} to wheat seeds named "&c&lCustom Seeds"
- set slot 15 of {_inv} to sugar cane named "&a&lFarming"
- set slot 16 of {_inv} to nametag named "&e&lPerks"
- open {_inv} to {_p}
- command /shop:
- trigger:
- mainShop(player)
- on inventory click:
- if event-inventory != player's inventory:
- if inventory name of current inventory of player = "&5&lShop":
- cancel event
- if event-slot = grass block:
- send "Block Shop"
- else if event-slot = heart of the sea:
- send "Misc Shop"
- else if event-slot = wheat seeds:
- set {_inv} to chest inventory with 3 rows named "&c&lCustom Seeds"
- set slot (integers from 0 to 8) of {_inv} to gray glass pane
- set slot 9 and 17 of {_inv} to gray glass pane
- set slot (integers from 18 to 26) of {_inv} to gray glass pane
- set slot 18 of {_inv} to red glass pane named "&4Main Menu"
- set slot 10 of {_inv} to wheat seeds named "&b&lWheat Plant" with lore "", "&7Place to use" and ""
- set slot 11 of {_inv} to wheat seeds named "&b&lCoal Plant" with lore "", "&7Place to use" and ""
- set slot 12 of {_inv} to wheat seeds named "&b&lIron Plant" with lore "", "&7Place to use" and ""
- set slot 13 of {_inv} to wheat seeds named "&b&lGold Plant" with lore "", "&7Place to use" and ""
- set slot 14 of {_inv} to wheat seeds named "&b&lDiamond Plant" with lore "", "&7Place to use" and ""
- set slot 15 of {_inv} to wheat seeds named "&b&lEmerald Plant" with lore "", "&7Place to use" and ""
- set slot 16 of {_inv} to barrier
- open {_inv} to player
- else if event-slot = nametag:
- set {_inv} to chest inventory with 3 rows named "&c&lCustom Seeds"
- set slot (integers from 0 to 8) of {_inv} to gray glass pane
- set slot 9 and 17 of {_inv} to gray glass pane
- set slot (integers from 18 to 26) of {_inv} to gray glass pane
- set slot 18 of {_inv} to red glass pane named "&4Main Menu"
- set slot 10 of {_inv} to cooked beef named "&c&lFeed" with lore "&7/feed for 15 minutes", "" and "&7Costs: $20k"
- set slot 11 of {_inv} to grass block named "&a&l+3 Plots" with lore "&73 Extra Plots", "" and "&7Costs: $2m"
- open {_inv} to player
- else if event-slot = sugar cane:
- set {_inv} to chest inventory with 6 rows named "&a&lFarming"
- set slot (integers from 0 to 8) of {_inv} to gray glass pane
- set slot 9,17,18,26,27,35,36 and 44 of {_inv} to gray glass pane
- set slot (integers from 46 to 53) of {_inv} to gray glass pane
- set slot 45 of {_inv} to red glass pane named "&4Main Menu"
- set slot 12 of {_inv} to 4 of pumpkin seeds named "&3Pumpkin Seeds" with lore "&fCosts:", "&f1x $4k", "&f16x $64k", "&f64x $256k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 11 of {_inv} to 4 of melon seeds named "&eMelon Seeds" with lore "&fCosts:", "&f1x $2k", "&f16x $32k", "&f64x $128k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 10 of {_inv} to 4 of beetroot seeds named "&9Beetroot seeds" with lore "&fCosts:", "&f1x $500", "&f16x $8k", "&f64x $32k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 13 of {_inv} to 16 of sugar cane named "&aSugar Cane" with lore "&fCosts:", "&f1x $8k", "&f16x $128k", "&f64x $512k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 14 of {_inv} to 16 of cactus named "&2Cactus" with lore "&fCosts:", "&f1x $8k", "&f16x $128k", "&f64x $512k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 15 of {_inv} to 8 of pumpkin named "&6Pumpkin" with lore "&fCosts:", "&f1x $12k", "&f16x $192k", "&f64x $768k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 16 of {_inv} to 8 of melon slice named "&9Melon Slice" with lore "&fCosts:", "&f1x $6k", "&f16x $96k", "&f64x $384k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 19 of {_inv} to 16 of nether wart named "&cNether Wart" with lore "&fCosts:", "&f1x $1.3k", "&f16x $20.8k", "&f64x $83.2k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- set slot 20 of {_inv} to 4 of soul sand named "&4Soul Sand" with lore "&fCosts:", "&f1x $700", "&f16x $11.2k", "&f64x $44.8k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
- open {_inv} to player
- else if event-slot = redstone block:
- send "Redstone Shop"
- function buySeeds(p: player, name: text, price: integer):
- if {_p}'s balance >= {_price}:
- remove {_price} from {_p}'s balance
- give {_p} 1 of wheat seeds named "&b&l%{_name}% Plant" with lore "", "&7Place to use" and ""
- function buyFarming(p: player, item: string, price: integer, x: integer, s: integer):
- if {_p}'s balance >= {_price}*{_x}:
- remove {_price}*{_x} from {_p}'s balance
- give {_p} {_x}*{_s} of {_item}
- function getItem(p: player, item: string, price: integer, s: integer, c: click type):
- buyFarming({_p}, {_item}, {_price}, 1, {_s}) if "%{_c}%" = "left mouse button"
- buyFarming({_p}, {_item}, {_price}, 16, {_s}) if "%{_c}%" = "right mouse button"
- buyFarming({_p}, {_item}, {_price}, 64, {_s}) if "%{_c}%" = "middle mouse button"
- on inventory click:
- if event-inventory != player's inventory:
- if event-slot = red glass pane:
- if name of event-slot = "&4Main Menu":
- mainShop(player)
- else if inventory name of current inventory of player = "&c&lCustom Seeds":
- cancel event
- if event-slot = wheat seeds:
- if name of event-slot = "&b&lWheat Plant":
- buySeeds(player, "Wheat", 250)
- else if name of event-slot = "&b&lCoal Plant":
- buySeeds(player, "Coal", 1000)
- else if name of event-slot = "&b&lIron Plant":
- buySeeds(player, "Iron", 3000)
- else if name of event-slot = "&b&lGold Plant":
- buySeeds(player, "Gold", 5000)
- else if name of event-slot = "&b&lDiamond Plant":
- buySeeds(player, "Diamond", 15000)
- else if name of event-slot = "&b&lEmerald Plant":
- buySeeds(player, "Emerald", 30000)
- else if inventory name of current inventory of player = "&a&lFarming":
- cancel event
- if event-slot = beetroot seeds:
- getItem(player, beetroot seeds, 500, 4, click type)
- else if event-slot = melon seeds:
- getItem(player, melon seeds, 2000, 4, click type)
- else if event-slot = pumpkin seeds:
- getItem(player, pumpkin seeds, 4000, 4, click type)
- else if event-slot = sugar cane:
- getItem(player, sugar cane, 8000, 16, click type)
- else if event-slot = cactus:
- getItem(player, cactus, 8000, 16, click type)
- else if event-slot = pumpkin:
- getItem(player, cactus, 8000, 8, click type)
- else if event-slot = nether wart:
- getItem(player, nether wart, 1300, 16, click type)
- else if event-slot = soul sand:
- getItem(player, soul sand, 700, 4, click type)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement