Keep getting this error [CODE][ERROR] addons/vehiclecontroller/lua/autorun/vc_dev_tool.lua:1058: function at line 881 has more than 60 upvalues 1. unknown - addons/vehiclecontroller/lua/autorun/vc_dev_tool.lua:0[/CODE]
Is that basically Lua's nice way of saying that I should cut down on the code?
All the code is fully functional, just that there is a hell lot of it in a single function, any way to bypass this error?
You should post that section of code will make it eaiser to help you.
You have more than 60 values from outer scopes in your closure. If you really need access to all of those you should pack some of them into a table. But really, you should never reach that limit.
So that's like?
[lua]
local n1
local n2
local n3
...
local n60+
function foo()
end
[/lua]
[QUOTE=jaooe;40183146]So that's like?
[lua]
local n1
local n2
local n3
...
local n60+
function foo()
end
[/lua][/QUOTE]
Yes, if the values are being used in the function.
[lua]local a1, a2, a3, ... a60, a61, a62
local function foo()
print(a1, a2, a3, ... a60, a61, a62)
end[/lua]
Thank you everyone, will just add the objects to table instead of localizing them.
Sorry, you need to Log In to post a reply to this thread.