//public void Restart()
    //{
    //    Debug.Log("wow howq buggy lmao");
    //    SceneManager.LoadScene(0);
    //}

    public void ChangeHealth(int amount) //changes your health by an amount
    {
        if (amount < 0)
        {
            if (isInvincible) //checks if invincible, if so it returns
            {
                return;
            }

            isInvincible    = true;           //sets you to invincible
            invincibleTimer = timeInvincible; //gives you the timer of invincible
            playerHit.GetComponent <AudioSource>().Play();
        }

        currentHealth = Mathf.Clamp(currentHealth + amount, 0, maxHealth);     //Does the math to calculate the Health

        PlayerPrefs.SetInt("CurrentHealth", currentHealth);
        Debug.Log(currentHealth + "/" + maxHealth);

        if (currentHealth == 0)
        {
            deathSound.Play();
            playerSprite.enabled = false;
            Destroy(rigidbody2d);
            boxCollider2d.enabled = false;
            Gameover.DeathMenu();
        }
    }