Skript Crashing My Server (need help with optimizing and fix the crashing problem)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Studio

Member
Mar 17, 2026
2
0
1
Code:
variables:
    {adminname::1} = ""
    {adminitem::1} = ""
    {adminoccupied::1} = false

    {adminname::2} = ""
    {adminitem::2} = ""
    {adminoccupied::2} = false

    {adminname::3} = ""
    {adminitem::3} = ""
    {adminoccupied::3} = false

    {adminname::4} = ""
    {adminitem::4} = ""
    {adminoccupied::4} = false

    {adminname::5} = ""
    {adminitem::5} = ""
    {adminoccupied::5} = false

    {adminname::6} = ""
    {adminitem::6} = ""
    {adminoccupied::6} = false

    {adminname::7} = ""
    {adminitem::7} = ""
    {adminoccupied::7} = false

    {adminname::8} = ""
    {adminitem::8} = ""
    {adminoccupied::8} = false

    {adminname::9} = ""
    {adminitem::9} = ""
    {adminoccupied::9} = false
   
    {unsetconfirmation::%player%} = 0
    {unsetnumber::%player%} = 0
# ADMIN TOOLS
# get chain - /admin get <item>
# set chain - /admin set <slot-id> <name>
# unset chain /admin unset <slot-id> <confirmation>
command /admin <text> [<text>] [<text>]:
    permission: op
    trigger:
        if arg-1 is "get":
            if arg-2 is set:
                if arg-2 is {adminitem::1} or arg-2 is {adminitem::2} or arg-2 is {adminitem::3} or arg-2 is {adminitem::4} or arg-2 is {adminitem::5} or arg-2 is {adminitem::6} or arg-2 is {adminitem::7} or arg-2 is {adminitem::8} or arg-2 is {adminitem::9}:
                    if {adminoccupied::arg-2} is true:
                        send "&aGave one of &e%{adminname::arg-2}%&a to %player%"
                        give player 1 of {adminitem::%arg-2%}
                    else:
                        send "&aSlot ID %arg-2% is currently empty"
                else:
                    message "Please enter a valid entry" to player
            else:
                send "&cPlease specify which slot you want!"
        if arg-1 is "set":
            if arg-2 is "1", "2", "3", "4", "5", "6", "7", "8" or "9":
                if {adminoccupied::%arg-2%} is true:
                    send "&cSlot %arg-2% is occupied with item &a%{adminname::arg-2}%"
                else:
                    if arg-3 is set:
                        set {adminitem::%arg-2%} to player's tool
                        set {adminname::%arg-2%} to "arg-3"
                        set {adminoccupied::%arg-2%} to true
                        send "&aSlot ID %arg-2% is set to &a%{adminname::arg-2}%"
                    else:
                        send "&cMake sure to name your item ID"
            else:
                message "&cValid Slot ID's 1-9" to player
        if arg-1 is "unset":
            if arg-2 is "1", "2", "3", "4", "5", "6", "7", "8" or "9":
                if {adminoccupied::%arg-2%} is true:
                    send "&cThe Slot ID %arg-2% is currently occupied by %{adminname::arg-2}%"
                    send "&cRun the command &a/admin confirm &cto delete!"
                    send "&cRun the command &a/admin cancel &cto cancel this action!"
                    set {unsetnumber::%player%} to arg-2
                    set {unsetconfirmation::%player%} to 1
                    wait 30 seconds
                    if {unsetconfirmation::%player%} = 1:
                        set {unsetconfirmation} to 0
                        send "&cYour confirmation period has been cancelled"
            else:
                message "&cValid Slot ID's 1-9" to player
        if arg-1 is "confirm":
            if {unsetconfirmation::%player%} is 1:
                set {unsetconfirmation::%player%} to 0
                set {adminname::%{unsetnumber::%player%}%} to ""
                set {adminitem::%{unsetnumber::%player%}%} to ""
                set {adminoccupied::%{unsetnumber::%player%}%} to false
        if arg-1 is "cancel":
            if {unsetconfirmation::%player%} is 1:
                send "&aPending confirmation cancelled"
                set {unsetconfirmation::%player%} to 0
                set {unsetnumber::%player%} to 0
               
on tab complete of "/admin":
    set tab completions for position 1 to "get", "set", "cancel", "confirm" and "unset"
    if tab arg-1 = "get":
        set tab completions for position 2 to {adminname::*}
    if tab arg-1 = "set":
        set tab completions for position 2 to "1", "2", "3", "4", "5", "6", "7", "8" and "9"
    if tab arg-1 = "unset":
        set tab completions for position 2 to "1", "2", "3", "4", "5", "6", "7", "8" and "9"
command /status:
    permission: op
    permission message: "&cYou must be an operator to use this command."
    trigger:
        send "&6--- Admin Slots Status ---" to player

        send "&eSlot 1:"
        send " &7Name: %{adminname::1}%"
        send " &7Item: %{adminitem::1}%"
        send " &7Occupied: %{adminoccupied::1}%"

        send "&eSlot 2:"
        send " &7Name: %{adminname::2}%"
        send " &7Item: %{adminitem::2}%"
        send " &7Occupied: %{adminoccupied::2}%"

        send "&eSlot 3:"
        send " &7Name: %{adminname::3}%"
        send " &7Item: %{adminitem::3}%"
        send " &7Occupied: %{adminoccupied::3}%"

        send "&eSlot 4:"
        send " &7Name: %{adminname::4}%"
        send " &7Item: %{adminitem::4}%"
        send " &7Occupied: %{adminoccupied::4}%"

        send "&eSlot 5:"
        send " &7Name: %{adminname::5}%"
        send " &7Item: %{adminitem::5}%"
        send " &7Occupied: %{adminoccupied::5}%"

        send "&eSlot 6:"
        send " &7Name: %{adminname::6}%"
        send " &7Item: %{adminitem::6}%"
        send " &7Occupied: %{adminoccupied::6}%"

        send "&eSlot 7:"
        send " &7Name: %{adminname::7}%"
        send " &7Item: %{adminitem::7}%"
        send " &7Occupied: %{adminoccupied::7}%"

        send "&eSlot 8:"
        send " &7Name: %{adminname::8}%"
        send " &7Item: %{adminitem::8}%"
        send " &7Occupied: %{adminoccupied::8}%"

        send "&eSlot 9:"
        send " &7Name: %{adminname::9}%"
        send " &7Item: %{adminitem::9}%"
        send " &7Occupied: %{adminoccupied::9}%"

        send "&6-------------------------" to player
# PREVENT PLUGIN VIEW
command /pl:
    trigger:
command /plugins:
    trigger:
command /bukkit:emoji_stuck_out_tongue:l:
    trigger:
command /bukkit:emoji_stuck_out_tongue:lugins:
    trigger:
 
Last edited by a moderator:
for more info my server is 1.21.11 running latest version of skript and skbee (downloaded of modrinth)
 
I can't see a reason that script would be why your server is crashing. You should have a crash log, can you upload that to something like Pastebin and share it please.