07real
📎 1 file 1,786 chars
📄
pasted-code-1789568209542.txt
txt 43 lines
▶
Create an advanced Minecraft script using ONLY the base Skript plugin (STRICTLY NO SkBee or other add-ons required). It must implement a Custom Kit system with specific combat kits, an interactive vanilla GUI, full Polish localization, and an IN-GAME KIT EDITOR for administrators.

Core Requirements:

Kit Types & Specific Items:

Kit Miecz (/kit miecz): Diamond/Netherite Sword, Golden Apples, Armor set.

Kit Buława (/kit mace): Mace weapon, Wind Charges, heavy combat gear.

Kit Włócznia (/kit spear): Trident/Spear, Shield, Speed Potions.

In-Game Admin Kit Editor (Vanilla Skript Variables):

Admin command: /kitedit  (Permission: kity.admin).

When executed, loop through all items in the admin's inventory and save them into a list variable (e.g., {kit::miecz::items::*}).

Send confirmation message in Polish: &aPomyślnie zapisano aktualny ekwipunek jako zestaw %arg-1%!.

Vanilla GUI Menu (/kity / /kit):

Open a standard chest inventory with 27 slots titled &8&lDOSTĘPNE KITY.

Fill empty slots with gray stained glass panes for a clean border.

Display icons for Miecz (Diamond Sword), Buława (Mace / Heavy Core), and Włócznia (Trident).

All Lore and Titles MUST be in Polish:

Title: e.g., &c&lZestaw Buława, &b&lZestaw Miecz, &e&lZestaw Włócznia.

Dynamic Lore: Show availability status (&aDostępny do odebrania, &cDostępny za: Xh Ym, or &cBrak uprawnień!).

Claim & Cooldown Logic:

Cancel inventory click events inside the /kity GUI to prevent item theft.

Save individual cooldown timers per kit using player UUIDs (e.g., {kit::cooldown::%uuid of player%::%kit%}).

When claimed, loop through saved kit items and give them directly to the player (give {_item} to player).

Send Polish feedback messages and play success sound (entity.player.levelup).
Kodari AI
KodariSep 16 at 2:20 pm 1
CustomKitSystem
Advanced Minecraft Skript plugin implementing a custom kit system with three combat kits (Miecz, Buława, Włócznia), a vanilla 27-slot GUI with Polish localization, per-player cooldown tracking via UUIDs, and an in-game admin kit editor that saves inventory contents to list variables. Includes permission checks, dynamic lore displaying availability status, click cancellation to prevent theft, Polish feedback messages, and success sounds. Built exclusively on base Skript with no add-ons required.

ಿನ್ನೆ

Created custom-kits.sk with:

  • Polish kit GUI available through /kit and /kity

  • Miecz, Buława, and Włócznia kits

  • Individual UUID-based cooldowns

  • Permission checks and Polish messages

  • Admin editor command: /kitedit <miecz|mace|spear>

  • Vanilla chest GUI with protected slots and dynamic lore

  • Default kit contents

  • Level-up sound on successful claim

Place it in plugins/Skript/scripts/, then run:

Plain Text
/sk reload custom-kits
Kodari can make mistakes. Review important code before using.
Files
custom-kits.sk
Code
1 192
custom-kits.sk
# Custom Kits — vanilla Skript only
# Place this file in plugins/Skript/scripts/ and run:
# /sk reload custom-kits
#
# Permissions:
# kity.miecz, kity.mace, kity.spear
# kity.admin

options:
    menu-title: &8&lDOSTĘPNE KITY
    cooldown-miecz: 24 hours
    cooldown-mace: 24 hours
    cooldown-spear: 24 hours

on script load:
    create-default-kits()

function create-default-kits():
    if {kit::miecz::items::*} is not set:
        set {_sword} to diamond sword
        enchant {_sword} with sharpness 3
        add {_sword} to {kit::miecz::items::*}

        set {_apples} to golden apple
        set amount of {_apples} to 8
        add {_apples} to {kit::miecz::items::*}

        add diamond helmet to {kit::miecz::items::*}
        add diamond chestplate to {kit::miecz::items::*}
        add diamond leggings to {kit::miecz::items::*}
        add diamond boots to {kit::miecz::items::*}

    if {kit::mace::items::*} is not set:
        set {_mace} to mace
        enchant {_mace} with density 3
        add {_mace} to {kit::mace::items::*}

        set {_charges} to wind charge
        set amount of {_charges} to 16
        add {_charges} to {kit::mace::items::*}

        set {_apples} to golden apple
        set amount of {_apples} to 4
        add {_apples} to {kit::mace::items::*}

        add netherite helmet to {kit::mace::items::*}
        add netherite chestplate to {kit::mace::items::*}
        add netherite leggings to {kit::mace::items::*}
        add netherite boots to {kit::mace::items::*}

    if {kit::spear::items::*} is not set:
        set {_trident} to trident
        enchant {_trident} with loyalty 3
        add {_trident} to {kit::spear::items::*}

        add shield to {kit::spear::items::*}

        set {_potions} to potion of swiftness
        set amount of {_potions} to 2
        add {_potions} to {kit::spear::items::*}

        add diamond helmet to {kit::spear::items::*}
        add diamond chestplate to {kit::spear::items::*}
        add diamond leggings to {kit::spear::items::*}
        add diamond boots to {kit::spear::items::*}

function kit-status(kit: text, p: player) :: text:
    if {_p} does not have permission "kity.%{_kit}%":
        return "&cBrak uprawnień!"

    if {kit::cooldown::%uuid of {_p}%::%{_kit}%} is set:
        if now is before {kit::cooldown::%uuid of {_p}%::%{_kit}%}:
            set {_remaining} to difference between {kit::cooldown::%uuid of {_p}%::%{_kit}%} and now
            set {_hours} to rounded down ({_remaining} / 1 hour)
            set {_minutes} to rounded down (({_remaining} - ({_hours} * 1 hour)) / 1 minute)
            return "&cDostępny za: %{_hours}%h %{_minutes}%m"

    return "&aDostępny do odebrania"

function get-kit-icon(kit: text, p: player) :: item:
    if {_kit} is "miecz":
        set {_icon} to diamond sword
        set name of {_icon} to "&b&lZestaw Miecz"
    else if {_kit} is "mace":
        set {_icon} to mace
        set name of {_icon} to "&c&lZestaw Buława"
    else:
        set {_icon} to trident
        set name of {_icon} to "&e&lZestaw Włócznia"

    set {_lore::*} to "&7Status: %{kit-status({_kit}, {_p})}%"
    add "&8" to {_lore::*}
    add "&eKliknij, aby odebrać zestaw." to {_lore::*}
    set lore of {_icon} to {_lore::*}
    return {_icon}

function open-kit-menu(p: player):
    open chest inventory with 3 rows named "{@menu-title}" to {_p}

    set {_pane} to gray stained glass pane named " "
    loop 27 times:
        set slot (loop-number - 1) of {_p}'s current inventory to {_pane}

    set {_miecz} to get-kit-icon("miecz", {_p})
    set {_mace} to get-kit-icon("mace", {_p})
    set {_spear} to get-kit-icon("spear", {_p})

    set slot 11 of {_p}'s current inventory to {_miecz}
    set slot 13 of {_p}'s current inventory to {_mace}
    set slot 15 of {_p}'s current inventory to {_spear}

function claim-kit(p: player, kit: text):
    if {_p} does not have permission "kity.%{_kit}%":
        send "&cNie masz uprawnień do odebrania tego zestawu!" to {_p}
        stop

    if {kit::cooldown::%uuid of {_p}%::%{_kit}%} is set:
        if now is before {kit::cooldown::%uuid of {_p}%::%{_kit}%}:
            send "&cTen zestaw jest jeszcze niedostępny. %{kit-status({_kit}, {_p})}%" to {_p}
            stop

    if {kit::%{_kit}%::items::*} is not set:
        send "&cTen zestaw nie ma zapisanych przedmiotów." to {_p}
        stop

    loop {kit::%{_kit}%::items::*}:
        give loop-value to {_p}

    if {_kit} is "miecz":
        set {_duration} to {@cooldown-miecz}
    else if {_kit} is "mace":
        set {_duration} to {@cooldown-mace}
    else:
        set {_duration} to {@cooldown-spear}

    set {kit::cooldown::%uuid of {_p}%::%{_kit}%} to now + {_duration}
    send "&aOdebrano zestaw %{_kit}%!" to {_p}
    play sound "entity.player.levelup" with volume 1 and pitch 1 to {_p}

command /kit [<text>]:
    aliases: kity
    trigger:
        if arg-1 is not set:
            open-kit-menu(player)
            stop

        if arg-1 is "miecz":
            claim-kit(player, "miecz")
        else if arg-1 is "mace":
            claim-kit(player, "mace")
        else if arg-1 is "spear":
            claim-kit(player, "spear")
        else:
            send "&cNieznany zestaw. Użyj: &e/kit miecz&c, &e/kit mace&c lub &e/kit spear&c." to player

command /kitedit [<text>]:
    permission: kity.admin
    permission message: &cNie masz uprawnień do edycji zestawów!
    trigger:
        if arg-1 is not set:
            send "&cUżycie: &e/kitedit <miecz|mace|spear>" to player
            stop

        if arg-1 is not "miecz" and arg-1 is not "mace" and arg-1 is not "spear":
            send "&cNieprawidłowy zestaw. Wybierz: &emiecz&c, &emace&c lub &espear&c." to player
            stop

        set {_kit} to arg-1
        delete {kit::%{_kit}%::items::*}

        loop all items in player's inventory:
            if loop-value is not air:
                add loop-value to {kit::%{_kit}%::items::*}

        send "&aPomyślnie zapisano aktualny ekwipunek jako zestaw %{_kit}%!" to player

on inventory click:
    if name of event-inventory is "{@menu-title}":
        cancel event

        if clicked inventory is not event-inventory:
            stop

        if clicked slot is 11:
            close player's inventory
            claim-kit(player, "miecz")
        else if clicked slot is 13:
            close player's inventory
            claim-kit(player, "mace")
        else if clicked slot is 15:
            close player's inventory
            claim-kit(player, "spear")