I disabled the inventory gui so I had to create my own keys to navigate through your tools. It works well but a player can repeatedly hit 1 and they will keep getting a sword.

Here's the script:

wait()

local p = game.Players.LocalPlayer
local h = p.Character.Humanoid
local e = p:GetMouse()
local down = false

e.KeyDown:connect(function(key)
if key:lower() == "1" then
down = true
p.Backpack.LinkedSword:Clone().Parent = p.Character
a=p.Character:FindFirstChlid("PaintballGun")
if a then
a:destroy()
end
end
end)

e.KeyUp:connect(function(key)
if key:lower() == "2" then
down = true
p.Backpack.PaintballGun:Clone().Parent = p.Character
b=p.Character:FindFirstChlid("LinkedSword")
if b then
b:destroy()
end
end
end)