0
local tab ={};

function tab:myFun(var,va1)
    print(self)  -- output 3  
    print(var,va1) -- output 4, nil
end

tab.myFun(3,4)
Oka
  • 23,367
  • 6
  • 42
  • 53

1 Answers1

1

Instead of this:

tab.myFun(3,4)

You need to call it with:

tab:myFun(3,4)
Sunderam Dubey
  • 1
  • 11
  • 20
  • 40
Ivo
  • 18,659
  • 2
  • 23
  • 35