Help with variable shortage!

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

Besotted

Member
Aug 8, 2025
3
0
1
Hello! My Minecraft Server concole has recently been overflowing with messages saying that "
Cannot write variables to the database 'default' at sufficient speed; server performance may suffer and many variables will be lost if the server crashes. (this warning will be repeated at most once every 10 seconds)" or "Skript cannot save any variables to the database 'default'. The server will hang and may crash if no more variables can be saved.". We have a lot of Skripts using varibles to "tag" players or mobs, like in the Skript below. I have recently trying to fix this problem by switching out many of the variables for metadata tags, but it don't seem as relyable. Do you know why this problem with metadata tags arise? Is there anything else you must do that's not just switching out the variables for metadatas or do you know any other method for reducing the amount of such variables?
Thanks a lot!

An example script, this one is a part of our combat-tags script:


Code:
every 1 second:
  loop all players:
    if {combattag.%loop-player%} is above 0:
      send action bar "&cYou are in combat for &4%{combattag.%loop-player%}% &cseconds!" to loop-player

on damage:
  if victim is a player:
    if attacker is a player:
      set {combattag.%victim%} to 10
      set {combattag.%attacker%} to 10
 
Last edited:
If you're constantly looping all players every second, yes, it will have problems with saving, especially when the server has lots of players. I suggest going with a completely new method and approach. Possibly by using YAML or local variables, perhaps a static method.
 
If you're constantly looping all players every second, yes, it will have problems with saving, especially when the server has lots of players. I suggest going with a completely new method and approach. Possibly by using YAML or local variables, perhaps a static method.
Alright. Is there anything specific you could recommend?