Call function declared below the function call

I have three functions in my lua file in below order

Func1

Func2

Func3

I call only Func3 first and once it done, at the end I call Func2. Once Func2 is executed I call Func1. But now once Func1 is done I have call back Func3 again. But when I do this I get error “Attemp to call upvalue ‘Func3’ <a table value>”.

Please help me for the above.

You will need to pre-declare Func 3:

Do this:

local Func3

– put in the code like you are doing for func1 and func2

Func3 = function()  – instead of local function Func3()

end

Rob

Thanks Rob. Thats solved it :slight_smile:

You will need to pre-declare Func 3:

Do this:

local Func3

– put in the code like you are doing for func1 and func2

Func3 = function()  – instead of local function Func3()

end

Rob

Thanks Rob. Thats solved it :slight_smile: