I am making a music player and I need to store all of the songs id's. I know there are String Value but this cannot store an array.
How can I store the song id's which also need to be individual to the client/user?
I am making a music player and I need to store all of the songs id's. I know there are String Value but this cannot store an array.
How can I store the song id's which also need to be individual to the client/user?
Lua has structures called Tables, which are more like Structs than anything else but behave like arrays when you want them to:
songIds = {1251366, 136134727, 125134, 1251366}
As for having different stored IDs for each player, the solution to that depends on what you're doing with this data.
Is there an alternative so that this is not in a script? ie The id's are not hard coded so that they can be changed?
There is not, sorry. I assumed this was what you were asking about, since this site is called ScriptingHelpers, after all. You could store the data as a JSON-formatted String, which only takes one function call to convert into a Lua Table.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
So what your asking is that is it possible to put sound ids' in a StringValue?
StringValue has a limit (200,000 characters) each time a player makes any changes all of this data would then have to be read into a table then used and then converted back which will be a bad solution but it can be done.