local player = game.Players.LocalPlayer
local char = player.Character
repeat wait()
until char:FindFirstChild("Humanoid").Health == 0
if char:FindFirstChild("Humanoid").Health == 0 then
	local all = char:GetChildren()
	for i,v in pairs(all) do
		if v.ClassName == "Tool" then
			v:Clone().Parent = player.Backpack
		end
	end
end

this script does not work. it is a script so that if the player has a tool in character it then this script will clone that tool when players health = 0.

3 comments

0

Use Humanoid.Died:connect() instead

0

XXahraternotXX is correct, but I'm also confused as to why you're cloning the tool to the player's backpack, in which they will die and lose it. If you don't want them to use it, Destroy() it

0

i dont want the tool to be destroyed when the player dies. i was told that clone the tool from player character then paste it in backpack to prevent that but it is not working. is there a way to stop the tool from being destroyed when player dies?