so this is inside a button that clears your inventory.
script.Parent.Visible = false
local p = game.Players.LocalPlayer
local items = p.Backpack:FindFirstChildOfClass("Tool")
local activated = false
script.Parent.MouseButton1Click:connect(function()
local tool = game.Players.LocalPlayer.Backpack:GetChildren()
script.Parent.Parent.Popcatsword.Visible = true
script.Parent.Parent.TextButton.Visible = true
script.Parent.Parent.shrek.Visible = true
script.Parent.Parent.bow.Visible = true
for i, child in ipairs(tool) do
child:Activate()
child:Deactivate()
child:Destroy()
end
script.Parent.Visible = false
end)

1 comment
Ok, so sorry about that, basically this is a local script in a button that is supposed to remove all items in your inventory. I wanted to have one that gives you weapons and then when you want to switch a weapon it deletes it from your inventory. It worked fine when a tool wasn't equipped, but when it was it didn't delete the tool. I want to check if it is equipped then unequip it so it can delete