I have a suggestion, that enables Update to return both number and string value, and that while maintaining backwards compatibility.
So, along with returning a number, or a string, Update can return a two-element table. The first element will be the number value, and the second will be the string value.
For example,
Screenshot 2022-09-02 224852.png
Now the example above is a lua script, and I have already made the said changes. Now, it's about what you guys think about it. I will be more than happy to have this feature. I mean
death.crafter wrote: ↑September 2nd, 2022, 5:26 pm
I have a suggestion, that enables Update to return both number and string value, and that while maintaining backwards compatibility.
So, along with returning a number, or a string, Update can return a two-element table. The first element will be the number value, and the second will be the string value.
For example,
Screenshot 2022-09-02 224852.png
Now the example above is a lua script, and I have already made the said changes. Now, it's about what you guys think about it. I will be more than happy to have this feature. I mean
I am fine with that, but the development team will probably want to discuss this internally. I suggest submitting a PR with the changes.
One note, you could probably verify the "type" of each element and assign it accordingly to the string/number values. This way, "order" wouldn't matter. You could probably accept nil and boolean values as well. nil having a number value of 0, and a empty string value. Boolean values having number values of 0 for false, 1 for true - and string values of "false" and "true";
Actually, enforcong the order will make things a little better.
Like returning {"24", "Twenty-Four"}, will give you the correct results. The number value can support numbers, string numbers, nil and booleans. The string part can support string and nil. You get the gist.