Attempt to call nil value

Script:

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

is this full script ? It makes error only in line 4 for me

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

Thank you all! :smiley: Ill test it rn.