1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Long lores crash my server

Discussion in 'Skript' started by Mattllama987, Apr 8, 2020.

Thread Status:
Not open for further replies.
  1. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    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 (Text):
    1. 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%::*}%"
     
  2. GuardDev

    GuardDev Member

    Joined:
    Apr 5, 2020
    Messages:
    19
    Likes Received:
    4
    Are there any errors?
     
  3. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Nope, no errors
     
  4. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    Can you please post the full code?

    Did you set an "wait a tick" before you set the item in the gui?
     
  5. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Yeah, i tried to wait a tick, and it still crashes.

    Code (Text):
    1. on command:
    2.     set {lastcmd::%player%} to "/%full command%"
    3. on first join:
    4.     set {ipaddress::%player%} to ip address of player
    5. on join:
    6.     set {ipaddress::%player%} to ip address of player
    7. on join:
    8.     set {location::%player%} to location of player
    9. on quit:
    10.     set {location::%player%} to location of player
    11. on any movement:
    12.     set {location::%player%} to player's location
    13. on chat:
    14.     delete {spychat::%Player%::*}
    15.     wait 1 ticks
    16.     add message to {spychat::%Player%::*}
    17. command /punish <offline player>:
    18.     permission: punish.punish
    19.     permission message: &7You dont have permission to use this command!
    20.     trigger:
    21.         if arg-1 is flying:
    22.             set {flying::%arg-1%} to true
    23.         else:
    24.             if arg-1 isn't flying:
    25.                 set {flying::%arg-1%} to false
    26.         if arg-1 is op:
    27.             set {op::%arg-1%} to true
    28.         else:
    29.             if arg-1 isn't op:
    30.                 set {op::%arg-1%} to false
    31.         set {_p} to arg-1
    32.         open chest with 6 rows named "&bPunishing: &c%arg-1%" to player
    33.         set {prefix} to arg-1's prefix
    34.         set {customprefix} to {custom::prefix::%arg-1%}
    35.         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 ""
    36.         if player has permission "admin.ban":
    37.             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%::*}%"
    38.  
     
  6. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    This error comes by my server.

    [​IMG]

    Try this with every slot-number, you want to set:
    Code (Text):
    1. set {_slot} to -1
    2. loop 53 times:
    3.   add 1 to {_slot}
    4.   {_slot} is between 0 and 9:
    5.     set slot {_slot} of player's current inventory to black stained glass pane named ""
     
  7. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Ok, i deleted that line and replaced it with yours. But it still crashes.
     
  8. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    I can't find a wait a tick as you create the Inventory :emoji_grinning:
     
  9. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    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 (Text):
    1. if player has permission "admin.ban":
    2.             wait 1 ticks
    3.             format gui slot 43
    --- Double Post Merged, Apr 8, 2020, Original Post Date: Apr 8, 2020 ---
    Not sure why the indentation is off lol
     
  10. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    No

    Code (Text):
    1.  open chest with 6 rows named "&bPunishing: &c%arg-1%" to player
    2. wait a tick
     
  11. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Still crashed. :/
     
  12. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    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 (Text):
    1. on command:
    2.     set {lastcmd::%player%} to "/%full command%"
    3. on first join:
    4.     set {ipaddress::%player%} to ip address of player
    5. on join:
    6.     set {ipaddress::%player%} to ip address of player
    7. on join:
    8.     set {location::%player%} to location of player
    9. on quit:
    10.     set {location::%player%} to location of player
    11. on any movement:
    12.     set {location::%player%} to player's location
    13. on chat:
    14.     delete {spychat::%Player%::*}
    15.     wait 1 ticks
    16.     add message to {spychat::%Player%::*}
    17. command /punish <offline player>:
    18.     permission: punish.punish
    19.     permission message: &7You dont have permission to use this command!
    20.     trigger:
    21.         if arg-1 is flying:
    22.             set {flying::%arg-1%} to true
    23.         else:
    24.             if arg-1 isn't flying:
    25.                 set {flying::%arg-1%} to false
    26.         if arg-1 is op:
    27.             set {op::%arg-1%} to true
    28.         else:
    29.             if arg-1 isn't op:
    30.                 set {op::%arg-1%} to false
    31.         set {_p} to arg-1
    32.         open chest with 6 rows named "&bPunishing: &c%arg-1%" to player
    33.         wait a tick
    34.         set {prefix} to arg-1's prefix
    35.         set {customprefix} to {custom::prefix::%arg-1%}
    36.         #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 ""
    37.         if player has permission "admin.ban":
    38.             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%::*}%"
    39.  
     
  13. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Omg that might have fixed it! Ima test a few more things with it. Thank you :emoji_slight_smile:
     
  14. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    You're welcome.
    --- Double Post Merged, Apr 8, 2020, Original Post Date: Apr 8, 2020 ---
    Please mark the Thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...