_technohammer

Create a production-ready Minecraft Paper 1.21.x Skript project called "BurnoutCS".

Requirements:

  • Use only Skript.
  • Compatible with the latest Skript version.
  • Use SkBee.
  • Use skript-INVENTORY GUI.
  • Use WorldEdit + FastAsyncWorldEdit (FAWE) for arena reset.
  • No Java plugin.
  • Modular and optimized code.
  • Split the project into multiple .sk files.
  • No syntax errors.
  • Fully commented.

========================== CUSTOM SERVER SYSTEM ==========================

Players can create their own private Custom Server (CS).

Commands:

  • /cs
  • /cs create
  • /cs invite <player>
  • /cs join
  • /cs leave
  • /cs password <password>
  • /cs removepassword
  • /cs kick <player>
  • /cs start
  • /cs close

========================== FEATURES ==========================

✔ /cs create

  • Creates a private room.
  • Creator becomes the owner.
  • Maximum one room per owner.

✔ /cs invite

  • Invite players.
  • Invite expires after 60 seconds.
  • Nice clickable chat message.

✔ /cs join

  • Join invited room.
  • Check password if enabled.
  • Prevent joining multiple rooms.

✔ Password Protected Rooms

  • Owner can set/remove password.
  • Password required before joining.

✔ Premium INVENTORY GUI

  • Beautiful INVENTORY GUI using skript-INVENTORY GUI.
  • Glass border.
  • Buttons:

- Create Room - Join Room - Arena - Invite - Start - Close Room - Leave Room - Room Settings

✔ Arena Selection

  • Unlimited predefined arenas.
  • Arena INVENTORY GUI.
  • One room can use one arena at a time.
  • Arena automatically locks.
  • Arena unlocks after match.

✔ Match Countdown

  • 10 second countdown.
  • Titles.
  • Sounds.
  • Action Bar.
  • Cancel if players leave.

✔ Teleport System

  • Teleport players to arena spawn.
  • Spectator spawn after death.
  • Return everyone to lobby after match.

✔ Winner Detection

  • Last player alive wins.
  • Broadcast winner only to room members.
  • Reward commands support.

✔ Arena Reset

  • Restore arena automatically using FAWE schematic.
  • Fast reset.
  • Unlock arena after reset.

✔ Room Management

  • Kick player.
  • Leave room.
  • Close room.
  • Auto delete empty rooms.

✔ Safety

  • Prevent duplicate rooms.
  • Prevent command abuse.
  • Handle disconnects.
  • Prevent joining while in match.

✔ Config.yml

  • Lobby Location
  • Countdown
  • Sounds
  • Messages
  • INVENTORY GUI Titles
  • Arena List
  • Max Players
  • Rewards

========================== CODE QUALITY ==========================

  • Production ready.
  • Optimized for Paper 1.21.x.
  • Modular.
  • Clean variables.
  • No memory leaks.
  • No deprecated syntax.
  • Easy to edit.
  • Generate every Skript file completely.
  • Never skip code.
  • Continue until the whole project is finished.
Kodari AI
KodariJul 18 at 2:02 pm 13
BurnoutCS
BurnoutCS provides a complete private Custom Server system for Paper 1.21.x using Skript, SkBee, skript-INVENTORY GUI, WorldEdit, and FAWE. Players create private rooms, invite friends with expiring clickable invitations, protect rooms with passwords, select locked arenas, start countdown-based matches, spectate eliminated players, detect winners, issue configurable rewards, reset arenas from FAWE schematics, and safely return players to the lobby after matches.
Kodari can make mistakes. Review important code before using.
Files
arenas.sk
commands.sk
config.sk
events.sk
gui.sk
invites.sk
matches.sk
rooms.sk
Code
8 768
rooms.sk
# BurnoutCS room storage and room management functions.

function cs_room_of(p: player) :: text:
    if {burnoutcs.player-room::%uuid of {_p}%} is set:
        return {burnoutcs.player-room::%uuid of {_p}%}
    return ""

function cs_lobby() :: location:
    return location at {@lobby-x}, {@lobby-y}, {@lobby-z} in world "{@lobby-world}"

function cs_room_exists(room: text) :: boolean:
    if {burnoutcs.room.%{_room}%::owner} is set:
        return true
    return false

function cs_room_message(room: text, message: text):
    loop {burnoutcs.room.%{_room}%::members::*}:
        if loop-value is online:
            send "{@prefix}%{_message}%" to loop-value

function cs_create_room(p: player):
    if cs_room_of({_p}) is not "":
        send "{@message-already-room}" to {_p}
        stop

    set {_room} to "%uuid of {_p}%"
    add {_room} to {burnoutcs.rooms::*}
    set {burnoutcs.room.%{_room}%::owner} to {_p}
    set {burnoutcs.room.%{_room}%::status} to "lobby"
    add {_p} to {burnoutcs.room.%{_room}%::members::*}
    set {burnoutcs.player-room::%uuid of {_p}%} to {_room}

    send "{@prefix}{@message-room-created}" to {_p}
    send "{@prefix}&7Use &b/cs invite <player> &7to invite players." to {_p}
    send "{@prefix}&7Use &b/cs arena &7to select an arena." to {_p}

function cs_teleport_room_to_lobby(room: text):
    loop {burnoutcs.room.%{_room}%::members::*}:
        if loop-value is online:
            set gamemode of loop-value to survival
            teleport loop-value to cs_lobby()

function cs_close_room(room: text):
    if cs_room_exists({_room}) is false:
        stop

    set {_arena} to {burnoutcs.room.%{_room}%::arena}
    if {_arena} is set:
        cs_reset_arena({_arena})
        delete {burnoutcs.arena.%{_arena}%::locked}

    cs_teleport_room_to_lobby({_room})

    loop {burnoutcs.room.%{_room}%::members::*}:
        delete {burnoutcs.player-room::%uuid of loop-value%}

    remove {_room} from {burnoutcs.rooms::*}
    delete {burnoutcs.room.%{_room}%::*}
    delete {burnoutcs.match.%{_room}%::*}

function cs_cancel_countdown(room: text):
    if {burnoutcs.room.%{_room}%::status} is not "countdown":
        stop

    set {burnoutcs.room.%{_room}%::status} to "lobby"
    set {_arena} to {burnoutcs.room.%{_room}%::arena}
    if {_arena} is set:
        delete {burnoutcs.arena.%{_arena}%::locked}

    cs_room_message({_room}, "{@message-match-cancelled}")

function cs_leave_room(p: player):
    set {_room} to cs_room_of({_p})
    if {_room} is "":
        send "{@message-not-room}" to {_p}
        stop

    set {_status} to {burnoutcs.room.%{_room}%::status}

    remove {_p} from {burnoutcs.room.%{_room}%::members::*}
    remove {_p} from {burnoutcs.match.%{_room}%::alive::*}
    delete {burnoutcs.player-room::%uuid of {_p}%}

    set gamemode of {_p} to survival
    teleport {_p} to cs_lobby()

    if {_status} is "countdown":
        if size of {burnoutcs.room.%{_room}%::members::*} < 2:
            cs_cancel_countdown({_room})

    if {_status} is "running":
        wait 1 tick
        cs_check_winner({_room})

    if size of {burnoutcs.room.%{_room}%::members::*} is 0:
        cs_close_room({_room})
        stop

    if {_p} is {burnoutcs.room.%{_room}%::owner}:
        set {_new-owner} to first element of {burnoutcs.room.%{_room}%::members::*}
        set {burnoutcs.room.%{_room}%::owner} to {_new-owner}
        cs_room_message({_room}, "&eThe previous owner left. &b%{_new-owner}% &eis now the room owner.")
    else:
        cs_room_message({_room}, "&e%{_p}% left the Custom Server.")

function cs_kick_player(owner: player, target: player):
    set {_room} to cs_room_of({_owner})
    if {_room} is "":
        send "{@message-not-room}" to {_owner}
        stop

    if {burnoutcs.room.%{_room}%::owner} is not {_owner}:
        send "{@message-owner-only}" to {_owner}
        stop

    if {burnoutcs.room.%{_room}%::status} is "running":
        send "{@message-room-running}" to {_owner}
        stop

    if {_target} is not in {burnoutcs.room.%{_room}%::members::*}:
        send "&cThat player is not in your room." to {_owner}
        stop

    remove {_target} from {burnoutcs.room.%{_room}%::members::*}
    delete {burnoutcs.player-room::%uuid of {_target}%}
    set gamemode of {_target} to survival
    teleport {_target} to cs_lobby()

    send "{@prefix}&cYou were removed from the Custom Server." to {_target}
    cs_room_message({_room}, "&e%{_target}% was removed from the Custom Server.")

function cs_set_password(p: player, password: text):
    set {_room} to cs_room_of({_p})
    if {_room} is "":
        send "{@message-not-room}" to {_p}
        stop

    if {burnoutcs.room.%{_room}%::owner} is not {_p}:
        send "{@message-owner-only}" to {_p}
        stop

    if {_password} is "":
        send "&cThe password cannot be empty." to {_p}
        stop

    set {burnoutcs.room.%{_room}%::password} to {_password}
    send "{@prefix}{@message-password-set}" to {_p}

function cs_remove_password(p: player):
    set {_room} to cs_room_of({_p})
    if {_room} is "":
        send "{@message-not-room}" to {_p}
        stop

    if {burnoutcs.room.%{_room}%::owner} is not {_p}:
        send "{@message-owner-only}" to {_p}
        stop

    delete {burnoutcs.room.%{_room}%::password}
    send "{@prefix}{@message-password-removed}" to {_p}