I tried doing
script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then game.Players[hit].Backpack.Key:Destroy() end end)
but it didn't work and I used the same name "Key for the tool" any help will be truly appreciated
Thanks,
Exsius,
toolname = "Tool name" script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then char = hit.Parent plr = game.Players:GetPlayerFromCharacter(char) if plr.Backpack:findFirstChild(toolname) then plr.Backpack[toolname]:Destroy() end end end)
-Thank me by accepting this answer/bumping up my reputation!