I want to remove an item called "gun" from my backpack when i pass through a transparent part. How do you do this. I have found code to delete the entire inventory, but i would like to just delete the specific item.
You could try this in a script inside the transparent part:
local itemName = "gun" script.Parent.Touched:Connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then local gun = plr.Backpack:FindFirstChild(itemName) or plr.Character:FindFirstChild(itemName) if gun then gun:Destroy() end end end)