I have a question about how to call function from table, similar with this one Function in table.
I want to have a table array that calls the function. Function can't exist in table, because I want it to be called from other sources.
Not like this
1
2
2
table = { [1] = {name = "Drop",func = TMMdrop(id) *do stuff here* end}}
But more like this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function TMMdrop(id) -- stuff end function TMMtake(id) -- stuff end function TMMequip(id) -- stuff end function TMmenu(id,t,b) local data = { [1] = {name = "Drop",func = TMMdrop(id)}, [2] = {name = "Take",func = TMMtake(id)}, [3] = {name = "Equip",func = TMMequip(id)} } for i = 1,#data do if type(data[i]) == "table" and t == data[i].name then 	data[i].func(id) 	break end end end
I hope that you understand what I am looking for and please help me to get there. Thank you very much
