tool save are wont work and how to fix?
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local DataStoreService = game:GetService("DataStoreService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SavedTool = DataStoreService:GetDataStore("SaveTool")
local ToolsStorage = ServerStorage:FindFirstChild("Storage")
local Armor = ReplicatedStorage.ITEMS.Armor
local Aura = ReplicatedStorage.ITEMS.Aura
local Bomb = ReplicatedStorage.ITEMS.Bomb
local Bow = ReplicatedStorage.ITEMS.Bow
local Potion = ReplicatedStorage.ITEMS.Potion
local Relic = ReplicatedStorage.ITEMS.Relic
local Spell = ReplicatedStorage.ITEMS.Spell
local Staff = ReplicatedStorage.ITEMS.Staff
local Sword = ReplicatedStorage.ITEMS.Sword
Players.PlayerAdded:connect(function(Players)
repeat wait() until Players:FindFirstChild("Backpack") and Players:FindFirstChild("StarterGear")
local Backpack, StarterGear = Players:FindFirstChild("Backpack"), Players:FindFirstChild("StarterGear")
local Data = SavedTool:GetAsync(Players.Name)
if Data then
print(Players.Name.." have saved tools.")
for i,v in pairs(Data) do
local TargetTool, TargetTool2 = ToolsStorage[v]:Clone(), ToolsStorage[v]:Clone()
if ToolsStorage:FindFirstChild(v) then
TargetTool.Parent = Backpack
TargetTool2.Parent = StarterGear
end
end
else
warn(Players.Name.."doesn't have any saved tools.")
end
end)