I’m not sure this is possible without item saving. You could possibly check if the humanoid dies and set a value as the tools name and clone it into the backpack when they respawn using a characteradded function.
local ToolsSaved = {};
local LocalPlayer = game["Players"]["PlrName"]
LocalPlayer["Character"]["Humanoid"]["Died"]:Connect(function()
for I, V in pairs(LocalPlayer["Backpack"]:GetChildren()) do
if V:IsA("Tool") then
table.insert(ToolsSaved, V["Name"])
end
end
end)
LocalPlayer["CharacterAdded"]:Connect(function()
for I, V in pairs(ToolsSaved) do
if ServerStorage:FindFirstChild(V) then
ServerStorage:FindFirstChild(V):Clone()["Parent"] = LocalPlayer["Backpack"]
end
end
ToolsSaved = {}
end)
I created something similar since I had my own things in play:
local SS = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local itemTools = SS.ItemTools
Players.PlayerAdded:Connect(function(player)
local character
local savedItems = {}
local con
local function Reconnect()
character = player.Character or player.CharacterAdded:Wait()
con = character:WaitForChild("Humanoid").Died:Connect(function()
for _, item in ipairs(player.Backpack:GetChildren()) do
if item:IsA("Tool") then
table.insert(savedItems, item.Name)
end
end
end)
end
Reconnect()
player.CharacterAdded:Connect(function()
for _, item in ipairs(savedItems) do
local newItem = itemTools[item]:Clone()
newItem.Parent = player:WaitForChild("Backpack")
end
savedItems = {}
con:Disconnect()
Reconnect()
end)
end)
local Game = game
local Players = Game:GetService("Players")
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
local Backpack = Player:FindFirstChildOfClass("Backpack") or Player:WaitForChild("Backpack")
local Humanoid = Player:FindFirstChildOfClass("Humanoid") or Player:WaitForChild("Humanoid")
local function OnHumanoidDied()
Humanoid:UnequipTools()
for _, Tool in ipairs(Backpack:GetChildren()) do
Tool.Parent = Player
end
end
Humanoid.Died:Connect(OnHumanoidDied)
for _, Tool in ipairs(Player:GetChildren()) do
if not (Tool:IsA("Tool")) then continue end
Tool.Parent = Backpack
end
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
Players.PlayerAdded:Connect(OnPlayerAdded)