Hello guys. I’m making tools module scripts which use metatables in order to store some important tool data. But I have got need to call this metafunctions with variables, like this:
local MetaModule = {}
MetaModule.__index = MetaModule
function MetaModule:MouseBtn1(Variable)
self.Var = Variable + 1
--do smth
end
function MetaModule:MouseBtn2(Variable)
self.Var = Variable - 1
--do smth
end
return setmetatable({}, MetaModule)
And other script which calling it like this:
local Module = require(ModuleAbove)
local FuncName = "MouseBtn1"
local Variable = 12
Module[FuncName](Variable)
Example above won’t parse “self” to function ModuleMeta:Test(). How I can make it so self will be parsed?