Vatsal Bhatia

make skript

📎 1 file 3,992 chars
📄
pasted-code-1793258589151.txt
txt 121 lines
▶
# Minecrown CoinShop — Complete Custom Shop Using Skript Only

Create a complete, working Minecraft shop system for my **Minecrown server running Paper/Spigot 1.21.1**.

## IMPORTANT RULES

- I do not have an existing CoinShop. Build the entire shop from scratch.
- **DO NOT USE DELUXEMENUS.**
- Do not install, depend on, or use DeluxeMenus for any part of the shop.
- Create the shop GUI using Skript's inventory GUI system and compatible addons only when necessary.
- Register `/coinshop` as the command that opens the shop.
- Keep all shop purchase logic and GUI interactions working together.
- Use my existing plugins for tags, glow effects, keys, and currency.

## 1. Plugins I Already Use

- **Skript** — create the custom shop and handle purchases.
- **PlayerPoints** — manages my players' Coins.
- **DeluxeTags** — existing custom tags available through `/tags`.
- **FancyGlow** — glow effects available through `/glow`.
- **ExcellentCrates / ExcellentKeys** — actual crate keys.

Do not use CoinsEngine, Vault money, EssentialsX money, or DeluxeMenus.

Use PlayerPoints as the backend currency system. In every player-facing message and menu, call the currency **Coins**, never Points or PlayerPoints.

## 2. Create the `/coinshop` GUI From Scratch

Use Skript to create an attractive inventory-based shop GUI.

Create these menus:

1. Main CoinShop menu
2. Custom Tags menu
3. Glow Colors menu
4. Crate Keys menu

The main menu must have three category items:

- Custom Tags
- Glow Colors
- Crate Keys

Requirements:
- `/coinshop` opens the main GUI.
- Clicking a category opens its submenu.
- Each submenu has a back button.
- Add a close button.
- Display the player's current Coins balance if supported.
- Show item names, prices, descriptions, and ownership status.
- Use attractive Minecraft colors and suitable icons.
- Make all click actions functional.
- Prevent players from taking shop display items out of the GUI.
- Prevent shift-clicks, number-key swaps, and double-clicks from duplicating or stealing items.
- Close or cancel unsafe inventory interactions correctly.
- Do not use DeluxeMenus.

## 3. DeluxeTags — Seven Existing Custom Tags

I have already created these tags in DeluxeTags. Do not recreate them.

| Tag | Price |
|---|---:|
| P2W | 200 Coins |
| PRO | 300 Coins |
| COCO | 400 Coins |
| EXOTIC | 550 Coins |
| FROSTBITE | 700 Coins |
| AURA | 850 Coins |
| SUMMER | 1,000 Coins |

When a player clicks a tag:

1. Check their Coins balance.
2. Check that the tag exists.
3. Check that they have not already unlocked it.
4. Deduct the exact price in Coins.
5. Grant the proper DeluxeTags permission or unlock through a supported API.
6. Make the tag available in `/tags`.
7. Allow the player to select and equip the tag.
8. Save permanent unlocks where required.
9. Prevent repeated purchases of an already-owned permanent tag.

Read the actual DeluxeTags configuration to identify the real tag IDs and permissions. Do not invent them.

## 4. FancyGlow — Sixteen Glow Colors

Create a Glow Colors submenu with the colors from my screenshot:

| Glow Color | Price |
|---|---:|
| Black | 200 Coins |
| Dark Blue | 200 Coins |
| Green | 200 Coins |
| Teal / Dark Cyan | 200 Coins |
| Dark Red | 200 Coins |
| Purple | 250 Coins |
| Orange / Gold | 250 Coins |
| Light Gray | 200 Coins |
| Gray | 200 Coins |
| Blue | 250 Coins |
| Lime Green | 250 Coins |
| Aqua | 250 Coins |
| Red | 250 Coins |
| Pink / Magenta | 300 Coins |
| Yellow | 250 Coins |
| White | 250 Coins |

Use appropriate colored icons and descriptions for each effect.

### Glow purchase logic

When a player buys a glow color:

1. Check their balance.
2. Verify the glow color is valid.
3. Check whether the player already owns the unlock.
4. Deduct the price.
5. Save the purchased unlock permanently.
6. Apply the glow color to the buyer immediately.
7. Allow the
Kodari AI
KodariOct 29 at 7:25 am 1
CoinShopGUI
A Skript-based custom shop system for Minecraft Paper servers. Registers /coinshop to open an inventory GUI with three categories: Custom Tags, Glow Colors, and Crate Keys. Uses PlayerPoints as Coins currency. Features submenus with back/close buttons, balance display, item prices, ownership status, and permanent unlock tracking. Prevents item theft via shift-clicks, number keys, and double-clicks. Integrates with DeluxeTags, FancyGlow, and ExcellentCrates/Keys APIs for purchases and unlocks.
  • Create one Skript file with the four menus, protected inventory interactions, and permanent purchase tracking.

  • Connect Coins through PlayerPoints and a PlaceholderAPI balance placeholder.

  • Leave plugin-specific tag IDs, glow IDs, and crate details configurable because the attached specification is truncated and does not include the DeluxeTags or FancyGlow configurations.

Place coinshop.sk in plugins/Skript/scripts/ and reload it with /sk reload coinshop. The attached text ends partway through the glow requirements, and it contains no actual DeluxeTags IDs, FancyGlow command syntax, or crate IDs/prices. Configure the unset IDs and disabled command templates in the script’s options using your plugins’ real configuration and commands before enabling purchases. The balance lookup also requires PlaceholderAPI, its PlayerPoints expansion, and a Skript placeholder addon.

Kodari can make mistakes. Review important code before using.
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