Solved Long lores crash my server

  • 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 comminuty!

    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!

Status
Not open for further replies.

Mattllama987

Active Member
Aug 5, 2018
225
7
18
24
Hi, im working on a punish skript, and the lore is so long that when i reload the skript, it crashes my server. Does anyone know of a way to make it not crash if the lore is very long?

Server version: 1.14.4
Skript version: 2.4

Code:
Code:
format gui slot 43 of player with head of {_P} named "&bMinecraft Information:" with lore "&bPlayer name: &c%arg-1%", "&bBalance: &c%balance of arg-1%", "&bRings: &c%{rings::%arg-1%}%", "&bPlayers Prefix: %{prefix}%", "&bPlayers ingame rank: %{customprefix}%", "&bPlayers IP Address: &c%{ipaddress::%arg-1%}%", "&bLast CMD: &c%{lastcmd::%arg-1%}%", "&bPing: &c%arg-1's ping%", "&bPlayers XP: &c%arg-1's xp%", "&bHealth of player: &c%health of arg-1%", "&bHunger of player: &c%hunger of arg-1%", "&bPlayers location: &c%{location::%arg-1%}%", "&bPlayers gamemode: &c%arg-1's gamemode%", "&bPlayer is op: &c%{op::%arg-1%}%", "&bPlayer is flying: &c%{flying::%arg-1%}%", "&bPlayers UUID: &c%arg-1's uuid%", "&bPlayers held item: &c%arg-1's held item%" and "&bLatest message: &c%{spychat::%arg-1%::*}%"
 
Can you please post the full code?

Did you set an "wait a tick" before you set the item in the gui?
Yeah, i tried to wait a tick, and it still crashes.

Code:
on command:
    set {lastcmd::%player%} to "/%full command%"
on first join:
    set {ipaddress::%player%} to ip address of player
on join:
    set {ipaddress::%player%} to ip address of player
on join:
    set {location::%player%} to location of player
on quit:
    set {location::%player%} to location of player
on any movement:
    set {location::%player%} to player's location
on chat:
    delete {spychat::%Player%::*}
    wait 1 ticks
    add message to {spychat::%Player%::*}
command /punish <offline player>:
    permission: punish.punish
    permission message: &7You dont have permission to use this command!
    trigger:
        if arg-1 is flying:
            set {flying::%arg-1%} to true
        else:
            if arg-1 isn't flying:
                set {flying::%arg-1%} to false
        if arg-1 is op:
            set {op::%arg-1%} to true
        else:
            if arg-1 isn't op:
                set {op::%arg-1%} to false
        set {_p} to arg-1
        open chest with 6 rows named "&bPunishing: &c%arg-1%" to player
        set {prefix} to arg-1's prefix
        set {customprefix} to {custom::prefix::%arg-1%}
        format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52 and 53 of player with black glass pane named ""
        if player has permission "admin.ban":
            format gui slot 43 of player with head of {_P} named "&bMinecraft Information:" with lore "&bPlayer name: &c%arg-1%", "&bBalance: &c%balance of arg-1%", "&bRings: &c%{rings::%arg-1%}%", "&bPlayers Prefix: %{prefix}%", "&bPlayers ingame rank: %{customprefix}%", "&bPlayers IP Address: &c%{ipaddress::%arg-1%}%", "&bLast CMD: &c%{lastcmd::%arg-1%}%", "&bPing: &c%arg-1's ping%", "&bPlayers XP: &c%arg-1's xp%", "&bHealth of player: &c%health of arg-1%", "&bHunger of player: &c%hunger of arg-1%", "&bPlayers location: &c%{location::%arg-1%}%", "&bPlayers gamemode: &c%arg-1's gamemode%", "&bPlayer is op: &c%{op::%arg-1%}%", "&bPlayer is flying: &c%{flying::%arg-1%}%", "&bPlayers UUID: &c%arg-1's uuid%", "&bPlayers held item: &c%arg-1's held item%" and "&bLatest message: &c%{spychat::%arg-1%::*}%"
 
This error comes by my server.

hpdxx72r.png


Try this with every slot-number, you want to set:
Code:
set {_slot} to -1
loop 53 times:
  add 1 to {_slot}
  {_slot} is between 0 and 9:
    set slot {_slot} of player's current inventory to black stained glass pane named ""
 
This error comes by my server.

hpdxx72r.png


Try this with every slot-number, you want to set:
Code:
set {_slot} to -1
loop 53 times:
  add 1 to {_slot}
  {_slot} is between 0 and 9:
    set slot {_slot} of player's current inventory to black stained glass pane named ""
Ok, i deleted that line and replaced it with yours. But it still crashes.
 
Yeah, i tried to wait a tick, and it still crashes.

Code:
on command:
    set {lastcmd::%player%} to "/%full command%"
on first join:
    set {ipaddress::%player%} to ip address of player
on join:
    set {ipaddress::%player%} to ip address of player
on join:
    set {location::%player%} to location of player
on quit:
    set {location::%player%} to location of player
on any movement:
    set {location::%player%} to player's location
on chat:
    delete {spychat::%Player%::*}
    wait 1 ticks
    add message to {spychat::%Player%::*}
command /punish <offline player>:
    permission: punish.punish
    permission message: &7You dont have permission to use this command!
    trigger:
        if arg-1 is flying:
            set {flying::%arg-1%} to true
        else:
            if arg-1 isn't flying:
                set {flying::%arg-1%} to false
        if arg-1 is op:
            set {op::%arg-1%} to true
        else:
            if arg-1 isn't op:
                set {op::%arg-1%} to false
        set {_p} to arg-1
        open chest with 6 rows named "&bPunishing: &c%arg-1%" to player
        set {prefix} to arg-1's prefix
        set {customprefix} to {custom::prefix::%arg-1%}
        format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52 and 53 of player with black glass pane named ""
        if player has permission "admin.ban":
            format gui slot 43 of player with head of {_P} named "&bMinecraft Information:" with lore "&bPlayer name: &c%arg-1%", "&bBalance: &c%balance of arg-1%", "&bRings: &c%{rings::%arg-1%}%", "&bPlayers Prefix: %{prefix}%", "&bPlayers ingame rank: %{customprefix}%", "&bPlayers IP Address: &c%{ipaddress::%arg-1%}%", "&bLast CMD: &c%{lastcmd::%arg-1%}%", "&bPing: &c%arg-1's ping%", "&bPlayers XP: &c%arg-1's xp%", "&bHealth of player: &c%health of arg-1%", "&bHunger of player: &c%hunger of arg-1%", "&bPlayers location: &c%{location::%arg-1%}%", "&bPlayers gamemode: &c%arg-1's gamemode%", "&bPlayer is op: &c%{op::%arg-1%}%", "&bPlayer is flying: &c%{flying::%arg-1%}%", "&bPlayers UUID: &c%arg-1's uuid%", "&bPlayers held item: &c%arg-1's held item%" and "&bLatest message: &c%{spychat::%arg-1%::*}%"

I can't find a wait a tick as you create the Inventory :emoji_grinning:
 
I tested it with wait 1 tick, and it still crashed lol. I just deleted the one i made, and put it back the way it was lol. It was like this:

Code:
if player has permission "admin.ban":
            wait 1 ticks
            format gui slot 43
[doublepost=1586369752,1586369720][/doublepost]Not sure why the indentation is off lol
 
I've loaded this code at my server and it works (without the glass panes because i'm lazy :emoji_grinning:

(The exp could not be used as expression)

Code:
on command:
    set {lastcmd::%player%} to "/%full command%"
on first join:
    set {ipaddress::%player%} to ip address of player
on join:
    set {ipaddress::%player%} to ip address of player
on join:
    set {location::%player%} to location of player
on quit:
    set {location::%player%} to location of player
on any movement:
    set {location::%player%} to player's location
on chat:
    delete {spychat::%Player%::*}
    wait 1 ticks
    add message to {spychat::%Player%::*}
command /punish <offline player>:
    permission: punish.punish
    permission message: &7You dont have permission to use this command!
    trigger:
        if arg-1 is flying:
            set {flying::%arg-1%} to true
        else:
            if arg-1 isn't flying:
                set {flying::%arg-1%} to false
        if arg-1 is op:
            set {op::%arg-1%} to true
        else:
            if arg-1 isn't op:
                set {op::%arg-1%} to false
        set {_p} to arg-1
        open chest with 6 rows named "&bPunishing: &c%arg-1%" to player
        wait a tick
        set {prefix} to arg-1's prefix
        set {customprefix} to {custom::prefix::%arg-1%}
        #format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52 and 53 of player with black glass pane named ""
        if player has permission "admin.ban":
            set slot 43 of player's current inventory to {_p}'s skull named "&bMinecraft Information:" with lore "&bPlayer name: &c%arg-1%", "&bBalance: &c%balance of arg-1%", "&bRings: &c%{rings::%arg-1%}%", "&bPlayers Prefix: %{prefix}%", "&bPlayers ingame rank: %{customprefix}%", "&bPlayers IP Address: &c%{ipaddress::%arg-1%}%", "&bLast CMD: &c%{lastcmd::%arg-1%}%", "&bPing: &c%{_p}'s ping'%", "&bPlayers XP: &c???", "&bHealth of player: &c%health of arg-1%", "&bHunger of player: &c%hunger of arg-1%", "&bPlayers location: &c%{location::%arg-1%}%", "&bPlayers gamemode: &c%arg-1's gamemode%", "&bPlayer is op: &c%{op::%arg-1%}%", "&bPlayer is flying: &c%{flying::%arg-1%}%", "&bPlayers UUID: &c%arg-1's uuid%", "&bPlayers held item: &c%arg-1's held item%" and "&bLatest message: &c%{spychat::%arg-1%::*}%"
 
Status
Not open for further replies.