(This is a question, I do not have a script to include.)
I just started learning tables. I know the basics of tables and how they store different values, and I also know how to use table.insert and table.remove and I know how to loop through them. What I want to know is how to use the tables that store data inside of the entry. For example:
local mytable = {["Player1"] = 5,["Player2"] = 7,["Player3"] = 9}
I do know that you can retrieve the data of one entry by doing this:
local val = mytable["Player1"]
I find these tables being very useful for maybe a leaderboard displaying player kills or a map voting system, or even to store multiple values in one DataStore key.
So, how do I add an entry to these tables? because table.insert(mytable,["Player4"]) will not do it.
Also, I know table.sort will sort these tables and put the highest number at index number 1, but I also do not know how to use that and need help with that as well.
Also, correct me for any mistakes I made.

1 comment
great answer 10/10