What wrong with this?

My 2d character controller works on horizontal movement when I stop on a slope it slides back down…

using UnityEngine;
using System.Collections;

public class movementScript : MonoBehaviour {

    public float maxSpeed = 10f;
    bool facingRight = true;

    Animator anim;
    public AudioClip jump;
  
    bool grounded = false;
    public Transform groundCheck;
    float groundRadius = 0.1f;
    public LayerMask whatIsGround;
    public float jumpForce = 700f;

    void Start () {
        anim = GetComponent<Animator>();
    }

    void FixedUpdate () {

        grounded = Physics2D.OverlapCircle(groundCheck.position, groundRadius, whatIsGround);
        anim.SetBool ("Ground", grounded);

        anim.SetFloat ("vSpeed", rigidbody2D.velocity.y);

        float move = Input.GetAxis("Horizontal");

        anim.SetFloat("Speed", Mathf.Abs (move));

        rigidbody2D.velocity = new Vector2(move * maxSpeed, rigidbody2D.velocity.y);

        if(move > 0 &&!facingRight)
            Flip ();

        else if (move < 0 && facingRight)
            Flip ();
    }


    void Update(){

        if (grounded && Input.GetKeyDown(KeyCode.UpArrow)){
            anim.SetBool ("Ground", false);
            rigidbody2D.AddForce(new Vector2(0, jumpForce));
            if(Input.GetKeyDown(KeyCode.UpArrow)){
                if(!audio.isPlaying){
                    audio.clip = jump;
                    audio.Play ();
                }
            }
        }
    }

    void Flip(){

        facingRight = !facingRight;
        Vector3 theScale = transform.localScale;
        theScale.x *= -1;
        transform.localScale = theScale;
    }
}

Did you try creating a Physics Material 2D with 1 on Friction?

It goes back down because gravity is pushing it down. Setting the friction could definitely help.

I did but it goes down by a little and it gets stuck going up the slope

it gets stuck going up the slope

This is how my slope looks

What you could do is make your character not affected by gravity once you hit the ground, and then once you jump, turn it back on.