Files
coinshop.sk
Code
1 455
coinshop.sk
options:
prefix: &8[&6CoinShop&8] &r
main-title: &8Minecrown CoinShop
tags-title: &8CoinShop &7» &dCustom Tags
glow-title: &8CoinShop &7» &bGlow Colors
keys-title: &8CoinShop &7» &6Crate Keys
balance-placeholder: playerpoints_points
points-take-command: points take {player} {amount}
tag-grant-command-template: disabled
glow-grant-command-template: disabled
glow-apply-command-template: disabled
crate-give-command-template: disabled
tag-p2w-id: unset
tag-pro-id: unset
tag-coco-id: unset
tag-exotic-id: unset
tag-frostbite-id: unset
tag-aura-id: unset
tag-summer-id: unset
glow-black-id: unset
glow-dark-blue-id: unset
glow-green-id: unset
glow-teal-id: unset
glow-dark-red-id: unset
glow-purple-id: unset
glow-orange-id: unset
glow-light-gray-id: unset
glow-gray-id: unset
glow-blue-id: unset
glow-lime-id: unset
glow-aqua-id: unset
glow-red-id: unset
glow-pink-id: unset
glow-yellow-id: unset
glow-white-id: unset
key-1-name: Key Offer 1
key-1-id: unset
key-1-price: 0
key-2-name: Key Offer 2
key-2-id: unset
key-2-price: 0
key-3-name: Key Offer 3
key-3-id: unset
key-3-price: 0
key-4-name: Key Offer 4
key-4-id: unset
key-4-price: 0
function coinshop_balance(p: player) :: integer:
set {_raw} to placeholder "{@balance-placeholder}" from {_p}
if {_raw} is not set:
return -1
set {_balance} to {_raw} parsed as integer
if {_balance} is not set:
return -1
return {_balance}
function coinshop_open_main(p: player):
set {_uuid} to uuid of {_p}
set {_inv} to chest inventory with 3 rows named "{@main-title}"
set {coinshop.menu::%{_uuid}%} to "main"
set {_coins} to coinshop_balance({_p})
if {_coins} < 0:
set slot 4 of {_inv} to gold nugget named "&eCoins: &cUnavailable" with lore "&7Balance lookup is not available."
else:
set slot 4 of {_inv} to gold nugget named "&eCoins: &f%{_coins}%" with lore "&7Your current Coins balance."
set slot 10 of {_inv} to name tag named "&d&lCustom Tags" with lore "&7Unlock tags for &f/tags&7.", "&eClick to browse"
set slot 13 of {_inv} to glowstone dust named "&b&lGlow Colors" with lore "&7Unlock and apply glow colors.", "&eClick to browse"
set slot 16 of {_inv} to tripwire hook named "&6&lCrate Keys" with lore "&7Purchase crate keys with Coins.", "&eClick to browse"
set slot 22 of {_inv} to barrier named "&cClose"
open {_inv} to {_p}
function coinshop_open_tags(p: player):
set {_uuid} to uuid of {_p}
set {_inv} to chest inventory with 3 rows named "{@tags-title}"
set {coinshop.menu::%{_uuid}%} to "tags"
set {_ids::1} to "{@tag-p2w-id}"
set {_ids::2} to "{@tag-pro-id}"
set {_ids::3} to "{@tag-coco-id}"
set {_ids::4} to "{@tag-exotic-id}"
set {_ids::5} to "{@tag-frostbite-id}"
set {_ids::6} to "{@tag-aura-id}"
set {_ids::7} to "{@tag-summer-id}"
set {_names::1} to "P2W"
set {_names::2} to "PRO"
set {_names::3} to "COCO"
set {_names::4} to "EXOTIC"
set {_names::5} to "FROSTBITE"
set {_names::6} to "AURA"
set {_names::7} to "SUMMER"
set {_prices::1} to 200
set {_prices::2} to 300
set {_prices::3} to 400
set {_prices::4} to 550
set {_prices::5} to 700
set {_prices::6} to 850
set {_prices::7} to 1000
loop 7 times:
set {_slot} to 9 + loop-number
set {_id} to {_ids::%loop-number%}
set {_tag} to {_names::%loop-number%}
set {_price} to {_prices::%loop-number%}
set {_status} to "&aAvailable"
if {_id} is "unset":
set {_status} to "&cTag ID not configured"
else if "{@tag-grant-command-template}" is "disabled":
set {_status} to "&cGrant command not configured"
else if {coinshop.owned::%{_uuid}%::tag::%{_id}%} is true:
set {_status} to "&aUnlocked"
set {_item} to name tag named "&d&l%{_tag}%" with lore "&7Price: &e%{_price}% Coins", "&7Status: %{_status}%", "", "&eClick to purchase"
set slot {_slot} of {_inv} to {_item}
set {coinshop.offer::%{_uuid}%::%{_slot}%::type} to "tag"
set {coinshop.offer::%{_uuid}%::%{_slot}%::id} to {_id}
set {coinshop.offer::%{_uuid}%::%{_slot}%::price} to {_price}
set {_coins} to coinshop_balance({_p})
if {_coins} < 0:
set slot 4 of {_inv} to gold nugget named "&eCoins: &cUnavailable"
else:
set slot 4 of {_inv} to gold nugget named "&eCoins: &f%{_coins}%"
set slot 18 of {_inv} to arrow named "&eBack"
set slot 22 of {_inv} to barrier named "&cClose"
open {_inv} to {_p}
function coinshop_open_glow(p: player):
set {_uuid} to uuid of {_p}
set {_inv} to chest inventory with 5 rows named "{@glow-title}"
set {coinshop.menu::%{_uuid}%} to "glow"
set {_ids::1} to "{@glow-black-id}"
set {_ids::2} to "{@glow-dark-blue-id}"
set {_ids::3} to "{@glow-green-id}"
set {_ids::4} to "{@glow-teal-id}"
set {_ids::5} to "{@glow-dark-red-id}"
set {_ids::6} to "{@glow-purple-id}"
set {_ids::7} to "{@glow-orange-id}"
set {_ids::8} to "{@glow-light-gray-id}"
set {_ids::9} to "{@glow-gray-id}"
set {_ids::10} to "{@glow-blue-id}"
set {_ids::11} to "{@glow-lime-id}"
set {_ids::12} to "{@glow-aqua-id}"
set {_ids::13} to "{@glow-red-id}"
set {_ids::14} to "{@glow-pink-id}"
set {_ids::15} to "{@glow-yellow-id}"
set {_ids::16} to "{@glow-white-id}"
set {_names::1} to "Black"
set {_names::2} to "Dark Blue"
set {_names::3} to "Green"
set {_names::4} to "Teal / Dark Cyan"
set {_names::5} to "Dark Red"
set {_names::6} to "Purple"
set {_names::7} to "Orange / Gold"
set {_names::8} to "Light Gray"
set {_names::9} to "Gray"
set {_names::10} to "Blue"
set {_names::11} to "Lime Green"
set {_names::12} to "Aqua"
set {_names::13} to "Red"
set {_names::14} to "Pink / Magenta"
set {_names::15} to "Yellow"
set {_names::16} to "White"
set {_prices::1} to 200
set {_prices::2} to 200
set {_prices::3} to 200
set {_prices::4} to 200
set {_prices::5} to 200
set {_prices::6} to 250
set {_prices::7} to 250
set {_prices::8} to 200
set {_prices::9} to 200
set {_prices::10} to 250
set {_prices::11} to 250
set {_prices::12} to 250
set {_prices::13} to 250
set {_prices::14} to 300
set {_prices::15} to 250
set {_prices::16} to 250
set {_icons::1} to black stained glass pane
set {_icons::2} to blue stained glass pane
set {_icons::3} to green stained glass pane
set {_icons::4} to cyan stained glass pane
set {_icons::5} to red stained glass pane
set {_icons::6} to purple stained glass pane
set {_icons::7} to orange stained glass pane
set {_icons::8} to light gray stained glass pane
set {_icons::9} to gray stained glass pane
set {_icons::10} to blue stained glass pane