Item overlapping

I’m trying to make all other items be destroyed when equipping a new one.
Basically when I equip a new item I want everything else to be destroyed besides the item I’m going to be equipping as there’s a one item limit in my game.

When equipping a new item it overlaps with the old item other than destroying the old item, using a auto equip script.

local Attacher = Instance.new("Attachment")
local Proxi = script.Parent.ProximityPrompt
Attacher.Parent = script.Parent
Proxi.Parent = script.Parent
wait()
script.Parent.ProximityPrompt.Triggered:Connect(function(Humanoid)
	Humanoid.Backpack:ClearAllChildren()
	local Copied = tool:Clone()
	Copied.Parent = Humanoid.Backpack
	Proxi.Enabled = false
	wait(300)
	Proxi.Enabled = true
end)```

This is because when a tool is equipped, it is no longer a child of the Backpack, but it is a child of the player’s character.

My suggestion is to include a line that unequips the tools BEFORE clearing the backpack.

Specifically, right before this line. Use the following link as reference.

1 Like