Attempt to call a boolean value OOP

This is my code:

local Module = require(game.ServerScriptService.Modules.ELS)
local selff = Module.New(script.Parent.Lightbar)
print(selff)
selff:Code3()

For soem reason, I don’t understand, it doesn’t works, it’s a script not localscript.

Here’s a bit of module:

local HTTPs = game:GetService('HttpService')
local ELS = {}
ELS.__index = ELS

function ELS.New(Lightbar)
	local self = {}
	self.IsOn = false
	
	self.Lightbar = Lightbar
	self.CornersOn = false
	self.Code3 = false
	return setmetatable(self,ELS)
end

:Code3() is defined aswell as all other functions.

1 Like

Code3 seems to be a mere boolean value. You can only call function values. If you wanted to access Code3, you would simply index it. print(selff.Code3)

3 Likes

Yeah, seems like I had function same as ‘Code3’ value

1 Like