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!

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

Script Zabrid's YAML Manager 1.2.1

Automatically manage your player's data!

  1. Zabrid
    Contributors:
    Zabrid
    Supported Minecraft Versions:
    • 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18
    THIS RESOURCE IS TO HELP SKRIPT DEVELOPERS MANAGE THEIR DATA. IT IS NOT FOR YOUR AVERAGE SERVER OWNER!

    Have you ever had problems with skript's built-in data storage system? Have you ever wanted to use Skript-YAML but didn't know how? Well then, this script has you covered!

    This script automatically sort all of your data into separate folders (per uuid) to ensure maximum server performance at all times. Not only that, it can also store server-side data (i.e unique players).

    Config:
    Code (Text):
    1. #
    2. # ###################################################################
    3.  
    4. # Zabrid's YAML Manager
    5. # Author(s): {zabrid}#3433
    6. # Version: 1.1.0
    7. # Date 4/26/22
    8.  
    9. # Required Plugins:
    10. # - Skript
    11. # - Skript-YAML
    12.  
    13. # Functions:
    14. # - zdata_server_setvalue(value: text, chicken: text, save: boolean): - Set server related data
    15. # - zdata_server_delvalue(value: text, save: boolean): - Delete server related data
    16. # - zdata_server_getvalue(value: text) :: text: - Get server related data
    17. # - zdata_server_save(): - Save all server related data
    18. # - zdata_player_setvalue(p: player, value: text, chicken: text, save: boolean): - Set data for a specific player
    19. # - zdata_player_delvalue(p: player, value: text, save: boolean): - Delete data for a specific player
    20. # - zdata_player_getvalue(p: player, value: text) :: text: - Get data from a specific player
    21. # - zdata_player_save(p: player): - Save a specific player's data
    22. # - zdata_player_gettop(value: text) :: texts: - Get a sorted list from high to low (Player data, duh)
    23.  
    24. # Values Cheat Sheet:
    25. # - chicken = What you're setting the value to
    26. # - value = The name of the variable you're setting.
    27. #   - Values can be split into different nodes by putting a "." (ex: "stats.blocks-placed.cactus")
    28. # - save = Do you want to save the data immediently?
    29.  
    30. # ###################################################################
    31.  
    32. # Configuration
    33. options:
    34.  
    35. #  How often the server will auto-save YAML data
    36.     auto-save-speed: 5
    37.  
    38. #  Whether or not the server will announce YAML data saving
    39.     auto-save-announcement-boolean: true
    40.  
    41. #  Only send the YAML saving announcement message to server ops
    42.     auto-save-announcement-ops-only: true
    43.  
    44. #  YAML data save message
    45.     auto-save-announcement-starting-message: "&8[&cData&8] &7Saving all player and server data..."
    46.     auto-save-announcement-ended-message: "&8[&cData&8] &7Successfully saved all player and server data. &8(&c%{_time}%&8)"
    47.  
    48. #  Still Loading Data Kick Message
    49.     still-loading-message: "&8&m                         %nl%%nl%&7You cannot join at this time.%nl%&7Data from the server is still being loaded.%nl%%nl%&cPlease try again in ~15 seconds.%nl%%nl%&8&m                         "
    50.  
    51. #  Do you want to automatically delete a YAML value if it is less than or equal to 0? (Only for numbers and integers)
    52.     do-not-save-numbers-equal-less-than-0: false
    53.  
    54. #  The folder where you want all data to go to.
    55. #  WARNING: IF YOU CHANGE THIS DATA DOES NOT TRANSFER
    56.     directory: plugins/ZabridYamlManager
    Example:
    Code (Text):
    1. # This is an example on how to use Zabrid's YAML Manager
    2. # This example shows how you could track a player's kills and deaths, aswell as make a leaderboard
    3.  
    4. on death:
    5.  
    6.     victim is a player
    7.  
    8.     set {_deaths} to zdata_player_getvalue(victim, "kill-tracker.deaths") parsed as integer # Retrieving the amount of deaths the victim has
    9.     add 1 to {_deaths} # Adding 1 to the amount of deaths the victim has
    10.     zdata_player_setvalue(victim, "kill-tracker.deaths", "%{_deaths}%", true) # Setting the amount of deaths the victim has. This data will be saved instantly.
    11.  
    12.     attacker is a player
    13.  
    14.     set {_kills} to zdata_player_getvalue(victim, "kill-tracker.kills") parsed as integer # Retrieving the amount of kills the attacker has
    15.     add 1 to {_kills} # Adding 1 to the amount of kills the attacker has
    16.     zdata_player_setvalue(victim, "kill-tracker.deaths", "%{_deaths}%", true) # Setting the amount of kills the attacker has. This data will be saved instantly.
    17.  
    18. on join:
    19.  
    20.     set {_deaths} to zdata_player_getvalue(player, "kill-tracker.deaths")
    21.     if "%{_deaths}%" is "<none>": # Skript bug, means you have to do it like this
    22.         zdata_player_setvalue(player, "kill-tracker.deaths", "0", false) # I did not save here because I will save later in the event
    23.  
    24.     set {_kills} to zdata_player_getvalue(player, "kill-tracker.kills")
    25.     if "%{_kills}%" is "<none>":
    26.         zdata_player_setvalue(player, "kill-tracker.kills", "0", false) # I did not save here because I will save later in the event
    27.  
    28.     zdata_player_save(player) # Saves all of the players YAML data
    29.  
    30. command /kills [<offline player>]:
    31.     trigger:
    32.         set {_p} to arg 1 ? player
    33.         set {_kills} to zdata_player_getvalue({_p}, "kill-tracker.kills")
    34.         if {_kills} is set:
    35.             send "&a%{_p}% has killed &n%{_kills}%&a people."
    36.         else:
    37.             send "&cThis player does not have any Kills data stored."
    38.  
    39. command /deaths [<offline player>]:
    40.     trigger:
    41.         set {_p} to arg 1 ? player
    42.         set {_deaths} to zdata_player_getvalue({_p}, "kill-tracker.deaths")
    43.         if {_deaths} is set:
    44.             send "&c%{_p}% has died &n%{_deaths}%&c times."
    45.         else:
    46.             send "&cThis player does not have any Deaths data stored."
    47.  
    48. # This is how you make a leaderboard with Zabrid's YAML Manager
    49.  
    50. command /killstop:
    51.     trigger:
    52.  
    53.         set {_leaderboard::*} to zdata_player_gettop("kill-tracker.kills")
    54.  
    55.         send "%{_leaderboard::1} parsed as offline player% &7is the top killer."
    56.  
    57.         send ""
    58.         send "&aTop 10 Killers on the server!"
    59.         send "&8-> &7Tracking &d%size of {_leaderboard::*}%&7 players"
    60.         send ""
    61.  
    62.         loop {_leaderboard::*}:
    63.  
    64.             if loop-index parsed as integer is greater than 10: #This means only the top 10 most kills will show up
    65.                 stop
    66.      
    67.             # loop-value = the UUID of the player
    68.             # loop-index = The player's position. This value is text by default, so parse it if you need to do math
    69.             set {_value} to zdata_player_getvalue(loop-value parsed as offline player, "kill-tracker.kills") # loop-value saved as the uuid of the player, so to get the name you need to parse as offline player
    70.  
    71.             send "&7 %loop-index%. &a%loop-value parsed as offline player% &8- &7%{_value}%"
    72.  
    73.         send ""
    Required Plugins:
    Code (Text):
    1.   Skript
    2.   Skript-YAML
    Support Discord: https://discord.gg/vMuWFWXJVy

Recent Updates

  1. 1.2.1
  2. 1.2.0
  3. 1.1.0