|
| 19 Mar 2016 02:40 AM |
for example how would I remove the 2nd index of this dictionary?
local playerScores = { ["ninetailfox"] = 10, ["ROBLOX"] = 7, ["Telamon"] = 3 } table.remove(playerScores,2) --This doesn't work |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 02:44 AM |
Dictionaries don't have an order, so to remove your index just do:
playerScores["ROBLOX"] = nil
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 19 Mar 2016 02:45 AM |
There isn't a "2nd index" in that table. There is "ninetailfox", "ROBLOX", and "Telamon".
|
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 02:51 AM |
| Also, referring to my first post, "key" would be a better name in place of index. |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 02:54 AM |
so to Insert I would do: playerScores["JimmyChance"] = 50 |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 02:55 AM |
| Also one more question.. Do you know if DataStores support dictionaries? Or only regular tables? |
|
|
| Report Abuse |
|
|
|
| 19 Mar 2016 03:13 AM |
| DataStores do support dictionaries. |
|
|
| Report Abuse |
|
|
riftg
|
  |
| Joined: 24 Nov 2008 |
| Total Posts: 1980 |
|
|
| 19 Mar 2016 06:07 AM |
6C799B15
@ninetailfox73 One what? Do you think I should know if it is? Tell me about your mother. jk I don't mean it
RiftG never sleeps |
|
|
| Report Abuse |
|
|