So a few days ago I came up with an idea of an alternative way to retrieve data from an offline player without using Entities’ Interference (EI). So the solution goes like this:
First, I will have a variable that consists of every player’s name within the world (called a list variable).
List = [“deefer”, “adam”, “sprink”]
So the list variable is not important in this code but if you want to add like checking whether if the user exists or not to avoid errors then you can utilize If variable text contains to check if the list encompasses the name or not.
Now to the second step which is the most crucial step in the whole code, Arrays.
So basically you would first need to find the length of the string/name of the player to be retrieved so we can indicate the position where the name ended:
So now we have the ended position which is 6, you will then set up a recursive function which will then consecutively truncate the name to splits into individual letters. From those letters multiply each of them with 1, 2, 2^2, 2^3, 2^4, etc… (geometric sequence). After that add all the values together and we will get a sum. The sum will then be used as the “index” to be retrieved from the array. And done, the value that you just got from the array’s index is the value to be retrieved from the offline player. Very simple yet lengthy, not recommend doing this unless you are some typical try harder. Just use EI, trust me it is more compact and relatable but I won’t tell since only a few coders know how to use that.
Edit: I’m not the first one to propose the idea of retrieving offline players’ data using arrays. I’m just the person that approved the idea is possible.
Store it inside an array then set up a function to extract all the index values from it. Or maybe like create 10 - 15 variables and then store each letter within each one of them. I know this code is super lengthy and the easiest way is to use entities.