for _,player in pairs(game.Players:GetPlayers()) do -- This line is causing the error.
local humanoid = player.Character.Humanoid
humanoid.Died:Connect(function()
local find = table.find(players, player)
table.remove(players, find)
end)
end
You aren’t even checking if the value exists but trying to remove it from a table if it exists or not.
And if that is your full script the table players doesn’t even exist.
for _,Player in pairs(game.Players:GetChildren())do
local Character = Player.Character
local Humanoid = Character:FindFirstChild("Humanoid")
if Humanoid ~= nil then
Humanoid.Died:Connect(function()
local Find = table.find(players, Player)
table.remove(players, Find)
end)
end
end