Saving Player Information

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

wesnoah3

Active Member
Aug 18, 2017
73
3
8
Hi all, I'm currently trying to save player information such as their experience in different categories (fire, earth, etc) but I feel as though my current method is inefficient.
https://pastebin.com/7ZSFTiJB
Is there a more efficient way of saving this type of information?
Thanks
 
Hi all, I'm currently trying to save player information such as their experience in different categories (fire, earth, etc) but I feel as though my current method is inefficient.
https://pastebin.com/7ZSFTiJB
Is there a more efficient way of saving this type of information?
Thanks
Seems alright, but I would suggest using list variables, ex:
code_language.skript:
set {savedInfo::%player%::fireXP} to 10
set {savedInfo::%player%::earthXP} to 20
this way, you can easily clear the players saved info if need be, like:
code_language.skript:
delete {savedInfo::%player%:*}
and it will delete all of the player's saved info
 
Seems alright, but I would suggest using list variables, ex:
code_language.skript:
set {savedInfo::%player%::fireXP} to 10
set {savedInfo::%player%::earthXP} to 20
this way, you can easily clear the players saved info if need be, like:
code_language.skript:
delete {savedInfo::%player%:*}
and it will delete all of the player's saved info
Great thanks! One question, why do you use a double colon between savedInfo and %player% instead of a period?
 
Great thanks! One question, why do you use a double colon between savedInfo and %player% instead of a period?
the double colon indicates a list variable, these are preferred over regular variables for various reasons, including quick deletion of entires lists, as well as looping.
 
the double colon indicates a list variable, these are preferred over regular variables for various reasons, including quick deletion of entires lists, as well as looping.
Wouldn't the double colon between %player% and fireXP be sufficient? Or should every period become a double colon?
 
Wouldn't the double colon between %player% and fireXP be sufficient? Or should every period become a double colon?
Do whatever you want. I told you why I use double colons throughout, but if you want to use a period, and restrict yourself with how you can use your variables down the road thats up to you!
 
Do whatever you want. I told you why I use double colons throughout, but if you want to use a period, and restrict yourself with how you can use your variables down the road thats up to you!
Sorry if I came out hostile, that wasn't my intention at all. I just noticed it seemed to still define as a list variable with only a double colon at the end and found a period for myself more readable. Thank you for the help.
 
Status
Not open for further replies.