I need help with this error. I’ve tried a lot of things to fix it. But it won’t fix
Output -
Script
local respawnFolder = script.ToolsForRespawn
local player = game:GetService("Players").LocalPlayer
local backpack = player:WaitForChild("Backpack")
local LoadoutEvent = game:GetService("ReplicatedStorage"):WaitForChild("CharacterEvents").SendLoadout
local LoadoutFolder = game:GetService("ServerStorage"):WaitForChild("CharacterLoadouts", 0.1)
LoadoutEvent.OnClientEvent:Connect(function(loadout)
local loadout_ = LoadoutFolder:FindFirstChild(loadout):GetChildren()
for amount, tool in ipairs(loadout_) do
local cloneTool = tool:Clone()
cloneTool.Parent = respawnFolder
end
end)
player.CharacterAdded:Connect(function()
local loadout_ = respawnFolder:GetChildren()
for amount, tool in ipairs(loadout_) do
local cloneTool = tool:Clone()
cloneTool.Parent = backpack
end
end)
local respawnFolder = script.ToolsForRespawn
local player = game:GetService("Players").LocalPlayer
local backpack = player:WaitForChild("Backpack")
local LoadoutEvent = game:GetService("ReplicatedStorage"):WaitForChild("CharacterEvents").SendLoadout
local LoadoutFolder = game:GetService("ServerStorage"):WaitForChild("CharacterLoadouts")
LoadoutEvent.OnClientEvent:Connect(function(loadout)
local loadout_ = LoadoutFolder:FindFirstChild(loadout):GetChildren()
for _, tool in ipairs(loadout_) do
local cloneTool = tool:Clone()
cloneTool.Parent = respawnFolder
end
end)
player.CharacterAdded:Connect(function()
local loadout_ = respawnFolder:GetChildren()
for _, tool in ipairs(loadout_) do
local cloneTool = tool:Clone()
cloneTool.Parent = backpack
end
end)
If this is a LocalScript and CharacterLoadouts is in ServerStorage at run time it will not replicate to the client, so it never exists. ServerStorage is only meant to be used by the server, not clients. Try moving it to ReplicatedStorage instead.