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