How to remove the Startgear tools from the datastore when the player enters the game?

Well, I know that removing the startergear part of the script, as fixed but it is not like that since if you do it, the tools are no longer added to the backpack. What I want is that moments after entering the tools are added to the player’s backpack and those of the startergear are eliminated (since when you reappear, the startergear tools are moved to the backpack) and thus when dying, they are not added to backpack

local dss = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local toolsDS = dss:GetDataStore("ToolDataPlayer")

local ServerStorage = game:GetService("ServerStorage")

local toolsFolder = ServerStorage.ToolsFolder

Players.PlayerAdded:Connect(function(plr)
	local OwnedTools = toolsDS:GetAsync(plr.UserId)

	for _, toolData in pairs(OwnedTools) do
		if not toolsFolder:FindFirstChild(toolData.ToolName) then continue end
		local Tool = toolsFolder[toolData.ToolName]:Clone()
		Tool:WaitForChild("Stack").Value = toolData.Stacks
		Tool.Parent = plr.Backpack
		local ToolGear = toolsFolder[toolData.ToolName]:Clone()
		ToolGear:WaitForChild("Stack").Value = toolData.Stacks
		ToolGear.Parent = plr.StarterGear
	end
	plr.CharacterRemoving:Connect(function(char)
		char.Humanoid:UnequipTools()
	end)
end)


Players.PlayerRemoving:Connect(function(plr)
	local OwnedTools = { }

	for i, tool in pairs(plr.Backpack:GetChildren()) do
		if not tool:IsA("Tool") then continue end
		table.insert(OwnedTools, {ToolName = tool.Name, Stacks = tool.Stack.Value})
	end
	local success, errormsg = pcall(function()
		toolsDS:SetAsync(plr.UserId, OwnedTools)
	end)
	if errormsg then
		warn(errormsg) 
	end
end)

I thought it might work if I put the “Character Added” function but I knew that the tools would be loading from the datastore, not from the startergear

I don’t understand what you are asking.
I assume you want to destroy the StarterGeal tools once a player joins, because he doesn’t respawn with those tools? If I got it right, then I don’t really understand why not just replicate those tools through the script without relying on StarterGear, and once .CharacterAdded() is called, just replicate these tools again.

mmmmmm, when you start the game and spawn the character, it dies immediately and spawns again (no script kills it)

Although good, I will try that and try to investigate what makes the character reappear