require "SimpleSilencersModelTable"

for weaponname, siltype in pairs(SimpleSilencersModelTable) do
	local item = ScriptManager.instance:getItem(weaponname)
	if item then 
		if siltype == 0 then -- Pistols
			item:DoParam("ModelWeaponPart = Silencer SilencerRifle muzzle muzzle")
			item:DoParam("ModelWeaponPart = MetalPipeSilencer MetalPipeSilencer muzzle muzzle")
		elseif siltype == 1 then -- Shotguns
			item:DoParam("ModelWeaponPart = Silencer SilencerBig muzzle muzzle")
			item:DoParam("ModelWeaponPart = MetalPipeSilencer MetalPipeSilencerBig muzzle muzzle")
		elseif siltype == 2 then -- Rifles
			item:DoParam("ModelWeaponPart = Silencer SilencerRifle muzzle muzzle")
			item:DoParam("ModelWeaponPart = MetalPipeSilencer MetalPipeSilencerRifle muzzle muzzle")
		end
	end
end

-- new approach to extent to other mods, still figuring out how to modulize it
-- tired, maybe continue one day when i got time and energy
-- -------------------------------------------------------------------------------------------------------------------------------
-- silencerMountList = ScriptManager.instance:getItem("Silencer.Silencer"):InstanceItem("Silencer.Silencer"):getMountOn()
-- print(ScriptManager.instance:getItem("Silencer.Silencer"):InstanceItem("Silencer.Silencer"):getMountOn())
-- print(type(silencerMountList))
-- print(type(tostring(silencerMountList)))
-- print(type(4))
-- print(type("adfasfa"))
-- print(type({21321,213123,123,2}))
