Metatable can't find an instance ; ;

Why are you doing Booster:SetFrame(Type) and not self:SetFrame(Type) in the constructor? You want to be setting the booster property of self, not the Booster table itself. Take this as an example.

local obj = {}
obj.__index = obj;
obj.x = 50;

function obj.new()
	local t = setmetatable({}, obj);
	t.x = 10;
	print(t:Test("x"), obj:Test("x"));
end

function obj:Test(x)
	return self[x];
end

obj.new();

Unless you had a pseudo-static member always use the instance of the object and not the object itself.

2 Likes