Elandorr
|
  |
| Joined: 25 Sep 2015 |
| Total Posts: 148 |
|
| |
|
|
| 26 Sep 2015 03:38 PM |
local function GetChildren(m) local num num = #m:GetChildren() return num end
just make it recursive |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:39 PM |
| Or #Model:GetChildren() :P |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:41 PM |
| fish i was trying to break it down for him. plus some lower level languages cant directly except a return value, so you need a variable. its just good practice. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:44 PM |
Honestly, it isnt. Why make a function when he can type #Model:GetChildren()
He didnt ask about other programming languages. He asked about RBX.lua |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:46 PM |
| I was saying that for one I was trying to break it down for him and two that didn't directly pertain to the situation I was saying that I do that for good practice because some lower-level languages do not allow for direct return values. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:47 PM |
| also I made it a function in case he needed to use it twice or maybe three or however many times also he couldn't make it recursive easier by the use of a function |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:48 PM |
| stupid voice recognizer I meant he could make it easier by using a function |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:48 PM |
So he can just make it a constant local Children = Model:GetChildren()
Also, 1 line is easier than 4. I am not trying to disprove you, you are right with what you said but it is a lot easier to do this. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:49 PM |
| I know and you have a valid point too, I am just saying it's good practice |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:50 PM |
| I think it is good practice to shorten the code plus, it uses less processing power when you use one simple constant. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:51 PM |
| no not that I'm saying it's good practice for if you're going to use Lower-level languages to just use a variable because they don't except direct return values a lot of the times |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:53 PM |
| But, he is not using a lower level programming language. He is using lua so it is not really good practice to do it that way. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:54 PM |
| it's good practice to know in some cases it won't even work with lua, itll through anerror |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:55 PM |
| It may be good practice to know but it certainly isn't good practice to use that in RBX.lua |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2015 03:57 PM |
| Fish I'm not trying to be rude but you know you're being a bit of a hypocrite I remember when I tried to tell you that you defined variable for child that you only used ones but yet you told me that there was nothing wrong with it and this case it's about the same thing |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|