I trying to make some form of weapon framework, where user can switch between a primary weapon (gun) and their melee weapon (a sword) I want to have this be OOP, and thus am running into queries on how to best achieve this.
At the moment, this is all I do on the server to setup, however, would I need to .new() everytime they equip a new gun, switch to melee weapon, etc. Ideally, they can change guns in round too, so .new() can’t contain a specific gun.
local WeaponHandler = {}
WeaponHandler.__index = WeaponHandler
function WeaponHandler.new(player, character)
local self = setmetatable({
Player = player,
Character = character,
Caster = FastCast.new(),
Debounce = tick(),
Maid = Maid.new()
}, WeaponHandler)
end
With this I was thinking of then having something like :EquipPrimary() and :EquipMelee() to kinda handle them both, but unsure