Self autocompletes do not show in modulescript

I have this modulescript here:

local module = {}

function module.new(cam: Camera)
	local self = setmetatable({},module)
	
	self.__test1 = 1
	function self:Test()
		return self.__test1
	end

	return self
end
return module

In the return function of self:Test(), typing self.__ does not show any autocomplete suggestions. What am I doing wrong?

You’ll need to use type-checking. Luau has documentation for using it with OOP here

2 Likes