The problem is the assignment of the new object to tt.
You need to do something like this :-
Function CreateTestType:testtype( ls )
Local tt:testtype = new testtype
inta = lua_newuserdata(ls, SizeOf(testtype))
Return tt
End Function
tt = CreateTestType()
You need to do something like this :-
Function CreateTestType:testtype( ls )
Local tt:testtype = new testtype
inta = lua_newuserdata(ls, SizeOf(testtype))
Return tt
End Function
tt = CreateTestType()