This code works:
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
tab = {
event = function() print(1) end;
}
function button()
return tab
end
button().event()
1
2
3
2
3
button() .event() .event()
Function in function that looks like a table
Function in function that looks like a table
1

tab = {
event = function() print(1) end;
}
function button()
return tab
end
button().event()
button() .event() .event()
tab = {
event = function() return {event = function() print(1) end} end
}
function button()
return tab
end
button().event().event()
tab = {}
function tab.event()
print(1)
return tab
end
function button()
return tab
end
button().event().event()
tab = {}
function tab:event()
print(1)
return self
end
function button()
return tab
end
button():event():event()
Dousea: This is so easy and I hadn't thought about it. Thanks m8! You help a lot.
1
