|
| 24 Feb 2014 10:29 PM |
local rando = math.random(1, #game.Lighting.Maps:GetChildren())
local cloon = game.Lighting.Maps:findfirstchild("MapNumber"..rando..):clone() |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2014 10:32 PM |
It would, however, if I were to make it, I would directly make it into
local cloon = game.Lighting.Maps["MapNumber"..math.random(1, #game.Lighting.Maps:GetChildren())]:Clone() |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2014 10:33 PM |
| Silly me. Why did I even use the findfirstchild method anyway? |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2014 10:35 PM |
| Hahaha, when I first started, I used to do findFirstChild(except in error checking), but I do not anymore, because I don't see any practical usage for anymore. An example would be in this. If the child is nil, using findFirstChild or indexing would error in any way because of the :Clone(). |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2014 10:38 PM |
| Yeah, findfirstchild returns a bool for if it is not nil. Ty |
|
|
| Report Abuse |
|
|