You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
Get rid of an error “Exception while signaling: Must be a LuaSourceContainer” -
What is the issue?
The Script i use to keep tools whenever i respawn keeps printing the error stated above every script thats included in every tool (my tools have 20 scripts total, so it prints around 18-20 errors every respawn) -
What solutions have you tried so far?
ive tried rewriting the code completly, and it still didnt work, tho it probably has to do something with :destroy() or just table saving
local Inventory = {}
local function Spawned(Char)
local Plr = game.Players:GetPlayerFromCharacter(Char)
for i,v in pairs(Inventory[Plr]) do
if Plr['Backpack']:findFirstChild(v.Name) then
Plr['Backpack'][v.Name]:Destroy()
end
v.Parent = Plr['Backpack']
end
Inventory[Plr] = {}
Char:WaitForChild('Humanoid').Died:connect(function()
for i,v in pairs({Plr['Backpack'], Char}) do
for ii,vv in pairs(v:GetChildren()) do
if vv:IsA('Tool') then
table.insert(Inventory[Plr], vv:Clone())
end
end
end
end)
end
game.Players.PlayerAdded:connect(function(Plr)
Inventory[Plr] = {}
local Char = Plr.Character or Plr.CharacterAdded:wait()
Spawned(Char)
Plr.CharacterAdded:connect(Spawned)
end)
Ive ben trying for a while already, and i cant seem to find the exact reason on why its happening, the script itself works as it should, but the error that get printed just scares me, i dont want the script to ruin everything i did so far.