|
| 12 Oct 2016 03:31 PM |
| Can you not use brackets to get a specific item anymore? |
|
|
| Report Abuse |
|
|
Exzeption
|
  |
| Joined: 01 Nov 2011 |
| Total Posts: 1312 |
|
|
| 12 Oct 2016 03:34 PM |
workspace:GetChildren()[1]
~The Low Brass Master |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2016 03:35 PM |
All of the items in the workspace should be keys of that userdata Example = { Part = "hi" }
print(Example.Part) print(Example[ 1])
getChildren however returns an array
workspace:getChildren()[1 ] |
|
|
| Report Abuse |
|
|
Exzeption
|
  |
| Joined: 01 Nov 2011 |
| Total Posts: 1312 |
|
|
| 12 Oct 2016 03:35 PM |
or if you had a part named 1 it would be workspace['1']
~The Low Brass Master |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2016 03:43 PM |
GameObjects:FindFirstChild(Category)[math.random(1, #GameObjects:FindFirstChild(Category)
It's giving me a error in the editor |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2016 03:44 PM |
1) use variables so you can read the code better 2) use getchildren to get an array of the children instead of the userdata of the whole object itself |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2016 03:45 PM |
| didn't paste bracket on the end |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2016 03:46 PM |
Example:
local options = Objects[Category]:getChildren() local pick = options[math.random(#options)] |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2016 03:46 PM |
so your saying i should just use
blabla:GetChildren()[2k14meme] |
|
|
| Report Abuse |
|
|
| |
|