How Do I Let The Player Have The Tool Even After Dying

So I have a gamepass that gives a tool when she/he buys it but when the player dies the tool disappear from the backback/inventory

so can someone help me on how to add a feature that still keeps the tool even after dying, I dont know where to start to make this feature so if somebody can help me i will appreciate it…

Where is the tool parented? You can use Humanoid.Died to detect when they die and clone all the tools from their backpack back into them.
something like this maybe

game.Players.PlayerAdded:Connect(function(player)
	local backpack = player:WaitForChild("Backpack")
	local character = player.Character or player.CharactedAdded:Wait()
	local humanoid = character:WaitForChild("Humanoid")
	
	humanoid.Died:Connect(function()
		local tools = {}
		for index, tool in pairs(backpack:GetChildren()) do
			if tool:IsA("Tool") then
				-- parent the tool where ever it is
			end
		end
	end)
end)
2 Likes

When you give the player the tool, also place a clone of it into StarterGear, it’s the simplest way of keeping the tool for the player after death

5 Likes

Yeah you could do that aswell lol

2 Likes

after they bought the gamepass i just cloned the tool to the character I dont know if that will put it on StarterGear as Im still new to scripting but i will change the clone parent to Startergear so thank you

Don’t just change the parent to StarterGear as that will only give the tool after respawns, make 2 clones and put one in their Backpack and one in their StarterGear

2 Likes

i just tried your solution and it works! thanks for the help i appreciate it

1 Like

Anytime! if you have anymore issues don’t be afraid to make another post!

2 Likes