So lets say I have this;
playerParam = {
['Username'] = plr.Name,
['Id'] = plr.PlayerId
}
( Ignore the fact I haven't defined plr)
How would I be able to select one of these items in a table?
So lets say I have this;
playerParam = {
['Username'] = plr.Name,
['Id'] = plr.PlayerId
}
( Ignore the fact I haven't defined plr)
How would I be able to select one of these items in a table?
There are two ways.
playerParam.Username or playerParam["Username"]
This is called indexing.
For more info on indexing and tables in general, please see this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thanks! So it's similar to the concept of ModuleScripts?
Module scripts usually return a table of functions, so yes.