generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Can you do table manipulation with dictionaries?

Previous Thread :: Next Thread 
ninetailfox73 is not online. ninetailfox73
Joined: 11 Mar 2008
Total Posts: 1954
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
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
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 is not online. 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
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
19 Mar 2016 02:51 AM
Also, referring to my first post, "key" would be a better name in place of index.
Report Abuse
ninetailfox73 is not online. ninetailfox73
Joined: 11 Mar 2008
Total Posts: 1954
19 Mar 2016 02:54 AM
so to Insert I would do:
playerScores["JimmyChance"] = 50
Report Abuse
ninetailfox73 is not online. ninetailfox73
Joined: 11 Mar 2008
Total Posts: 1954
19 Mar 2016 02:55 AM
Also one more question.. Do you know if DataStores support dictionaries? Or only regular tables?
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
19 Mar 2016 03:13 AM
DataStores do support dictionaries.
Report Abuse
riftg is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image