39th edit of the toolsave script.still couldnt reach my goal.
local SavedTools = game:GetService("ServerStorage"):WaitForChild("SavedTools")
script.RemoteEvent.OnServerEvent:Connect(function(Plr,Tools)
local Chr = Plr.Character or Plr.CharacterAdded:Wait()
if Chr:FindFirstChildWhichIsA("Tool") or Plr.Backpack:FindFirstChildWhichIsA("Tool") then
Chr.Humanoid:UnequipTools()
for i,v in ipairs(Tools) do
v.Parent = SavedTools
end
end
Plr.CharacterAdded:Wait()
for i,v in ipairs(SavedTools:GetChildren()) do
v.Parent = Plr.Backpack
end
end)
Client:
local Plr = game:GetService("Players").LocalPlayer
local Chr = Plr.Character or Plr.CharacterAdded:Wait()
Chr.Humanoid.Died:Connect(function()
script.Parent.RemoteEvent:FireServer(Plr.Backpack:GetChildren())
end)
i have tried getting on the server too.it adds the tools into the table,but doesnt parent to player backpack
is this a torture? i have edited it 39 times and still no works.