Am I using self right?

Hello,

I am new to OOP (Object Oriented Programming), I have a question… am I using self right?
Here’s the module:

local settings = {}
settings.__index = settings
local config = require(game:GetService("ReplicatedStorage"):FindFirstChild("WeaponConfig"))
function settings:SetModel(model: Model?, weapon: string?)
	local configGun = config.Melee[weapon]
	if configGun then
		if model:IsA("Model") and model:FindFirstChild("Handle") then
			configGun.Model = model
			self[weapon .. "Model"] = model
		else
			return nil
		end
	else
		return nil
	end
end
return settings

Thanks in advance

I updated my module, still need responses:

function settings.new_weapon(name: string?, price: number?, damage: number?, isShiny: boolean?, normal_version: string?, description: string?, rarity: string?)
	local newConfig = setmetatable(settings, {
		Damage = damage,
		Model = nil,
		Price = price,
		IsShiny = isShiny,
		NormalVersion = normal_version,
		Description = description,
		Rarity = rarity,
	})
	config.Melee[name] = newConfig
	return newConfig
end
function settings:SetModel(model: Model?, weapon: string?)
	local configGun = config.Melee[weapon]
	if configGun then
		if model:IsA("Model") and model:FindFirstChild("Handle") then
			configGun.Model = model
			self[weapon .. "Model"] = model
			return configGun
		else
			return nil
		end
	else
		return nil
	end
end

What is the value of self? Is it part of your metatable or is it a “settings” object?

Already fixed the problem… thanks for the help though!