Equip and unequip not working

Hello, I am trying to make a system where you can equip a tower and unequip it.

This will be the menu that will popup when you want to edit which slot you want it to be in. (I am not working on the sell button yet.

ah

The problem is that it wouldn’t place it in the slot I want.

localscript (each slot has one)

local player = game.Players.LocalPlayer
local RS = game:GetService("ReplicatedStorage")
local event = RS:WaitForChild("ChangeEvent")
script.Parent.MouseButton1Down:Connect(function()
	
	for i, v in pairs(player.Inventory:GetChildren()) do
		if v.Name == "Tower1" then
			event:FireServer(v, script.Parent.Parent.Names.Text)
			task.wait()
			script.Parent.Parent.Visible = false
			
		end
	end
end)

Script:

local RS = game:GetService("ReplicatedStorage")
local event = RS:WaitForChild("ChangeEvent")


event.OnServerEvent:Connect(function(plr, tower, val1)
	
	
	if tower.Name == "Tower1" then
		if tower.Value ~= "None" then
			local x = Instance.new("StringValue", plr.Storage)
			x.Name = plr.Inventory.Tower1.Value

		end
		
		task.wait()
		tower.Value = val1
		plr.Storage:FindFirstChild(val1):Destroy()
	elseif tower.Name == "Tower2" then
		if tower.Value ~= "None" then
			local x = Instance.new("StringValue", plr.Storage)
			x.Name = plr.Inventory.Tower1.Value

		end

		task.wait()
		tower.Value = val1
		plr.Storage:FindFirstChild(val1):Destroy()
	elseif tower.Name == "Tower3" then
		if tower.Value ~= "None" then
			local x = Instance.new("StringValue", plr.Storage)
			x.Name = plr.Inventory.Tower1.Value

		end

		task.wait()
		tower.Value = val1
		plr.Storage:FindFirstChild(val1):Destroy()
	elseif tower.Name == "Tower4" then
		if tower.Value ~= "None" then
			local x = Instance.new("StringValue", plr.Storage)
			x.Name = plr.Inventory.Tower1.Value

		end

		task.wait()
		tower.Value = val1
		
	
	end
	
	
end)

I have a video of what it does.