Can Anyone Help me with deleting a tool from everybody's inventory?

i dont have any of the scripts but can anyone help me make it where once a key touches a block it deletes from everybodys inventory if they have it?

Could you elaborate a bit more about what is happening?

So basically I want it where if someone uses a key for a door and other people have it it deletes out of everybody’s inventory cuz it doesn’t need to be used anymore

R u using custom inventory or just the backpack?

custom inventory(30 lettttttttttterrrrrrs)

but the items still go into character and their backpack in players

Then we need the scripts since with tht only we can suggest solutions.

well i dont really need to do that, it still goes in character and players backpack so could u just help me delete it from there>

and where would i put that script

Check this out!. This is a serverscript, to remove all players tools use GetPlayers from the Players service and loop through it

local players = game:GetService("Players")

for _, player in ipairs(players:GetPlayers()) do
	local char = player.Character
	if char:FindFirstChild("Tool") then
		char:FindFirstChild("Tool"):Destroy()
	elseif player.Backpack:FindFirstChild("Tool") then
		player.Backpack:FindFirstChild("Tool"):Destroy()
	end
end

This will delete it from both the character model of the player (if equipped) and the backpack of the player (if unequipped). Change “Tool” to the name of the tool, and run the for loop whenever necessary.

2 Likes