How is code going to help anything? I already showed in my post what I was asking for. I dont need help with my code, I need help with general scripting functions that utilizes a return of the first function within the second function
I’m assuming you mean something like this. Yes you can if it is.
local function a()
local function b()
return a -- "a" holds our function, so we can call it normally
local functionResult = b() -- a is returned, so we can do the following:
print(functionResult()) -- should print 4!
Let’s say we have functions a and b. Function b is nested within function a, and you want function b to be able to stop execution of function a. You can return a flag from function b to determine whether or not to return within function a.
local function a(): nil
local function b(): boolean
if b() then
return; --This will break out of a if b returns true