Automatically putting tool in player's backpack instead of character

Is there a way to make it so that when a tool is dropped and a player picks it up, it automatically goes in the backpack instead of the player’s character?

What do you mean? when you pick up a tool it goes into your backpack… do you mean so that it stays in the backpack even after you respawn?

I think you have to use your own inventory system.

If a character picks up a tool, it automatically gets equipped

Put this in tool.

local ToolPart = script.Parent.Handle -- locate to Handle part

ToolPart.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		wait()
		script.Parent.Parent = plr.Backpack
	end
end)
1 Like

I tested, and It worked. (char limit)

The best fix I could think of is to check whether it was previously in the backpack before equipping it.

game.Players.PlayerAdded:Connect(function(plr)
	local items = {}

	plr.Backpack.ChildAdded:Connect(function(child)
		if child:IsA("Tool") then
			table.insert(items, child)
		end)
	end)

	plr.CharacterAdded:Connect(function(char)
		char.ChildAdded:Connect(function(child)
			if child:IsA("Tool") then
				if not table.find(items, child) then
					child.Parent = plr.Backpack
				else
					table.remove(items, table.find(items, child))
				end
			end
		end)
	end)
end)