Short answer: to call a function (reference) stored in an array, you simply add (parameters) , as usual:
local function func(a,b,c) return a,b,c end local a = {myfunc = func} print(a.myfunc(3,4,5)) -- prints 3,4,5
In fact, you can simplify this for
local a = {myfunc = function(a,b,c) return a,b,c end} print(a.myfunc(3,4,5)) -- prints 3,4,5
Long answer: you do not describe what the expected results are, but what you wrote will most likely not do what you expect from it. Take this snippet:
game_level_hints.levels["level0"] = function() return { [on_scene("scene0")] = { talk("hint0"), } } end
[This paragraph no longer applies after the question has been updated] You are referring to the on_scene and talk functions, but you are not โstoringโ these functions in a table (since you explicitly referred to them in your question, I assume that this is these functions). In fact, you call these functions and save the return values โโ(they return nil ), so when this fragment is executed, you get the "index index no" error, because you are trying to save nil with nil as an index.
If you want to call the function that you saved in game_level_hints.levels["level0"] , just do game_level_hints.levels["level0"]()