|
| 28 Feb 2012 07:02 PM |
| What would happen. I need to sort of create the situation... |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2012 07:03 PM |
Nothing, assuming you won't be calling it repeatedly, which would create a stack overflow.
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Feb 2012 07:22 PM |
Like...
function x() x() end x() ? In that case, you would get an error "Stack Overflow" and you'd continue on in life. However, to fix this problem return x().
What do you think recursion is?
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2012 07:46 PM |
No, like this:
function x() -- long function end
x()
blah.Changed:connect(function() x() end)
|
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 28 Feb 2012 07:47 PM |
Why wouldn't it work?
"Bro five! Wear this to let everyone know you think they deserve a high five." |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 28 Feb 2012 07:59 PM |
Make sure its not a local function either, but you can still use up-values:
#Yes
local x do local a = -1 function x() a = a+1 print(a) return a < 10 and x() end end
x()
#No
do local a = -1 local function x() a = a+1 print(a) return a < 10 and x() end end
x()
|
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
| |
|