Consider storing the value in a temporary variable Error

using UnityEngine;
using System.Collections;

	public class YSpeed : MonoBehaviour {
		
		KeyCode moveUp;
		KeyCode moveDown;
		
		float speed = 10;
		
		void  Update (){
			if (CFInput.GetKey(moveUp))
			{
				rigidbody.velocity.y = speed;
			}
			else if (CFInput.GetKey(moveDown))
			{
				rigidbody.velocity.y = speed *-1;
			}
			else
			{
				rigidbody.velocity.y = 0;
			}
		}
	}

it’s says ‘Cannot modify a value type return value of `UnityEngine.Rigidbody.velocity’. Consider storing the value in a temporary variable.’

It was Javascript at the first and im trying to convert to C#.

You need to modify the entire velocity variable. x, y and z are read-only.
Nonetheless it is not recommended to modify the velocity variable. You should use Physics stuff instead, like AddForce().

rigidbody.velocity = new Vector3(rigidbody.velocity.x, speed, rigidbody.velocity.z);