if statements in a boolean method

I'm trying to make a bool method that returns true or false, depending on the if-statements in the method. Being new to coding I'm unsure how to proceed. This is what I created:

public bool activateItem() {
    if (playerCollision == true) {
        if (playerItemScript.curTouchedItem == itemName) {
            if (Input.GetButtonDown("Activate") == true && moveScript.movementEnabled == true) {
                return true;
            }
        }
    }
}

But I'm getting this error: Assets/Scripts/Items/StaticItemScript.cs(25,21): error CS0161: `StaticItemScript.activateItem()': not all code paths return a value

Anybody can help me out?

The error means that you haven't considered what the function should return if no if-branches lead to the return true. What if playerCollision = false? There is nothing saying what you should return.

To strip away some code and focus on the real problem you have, consider this:

public bool activateItem() 
{
    if (something == true)
    {
        return true;
    }
    // Well, if it isn't true, what should we return?
    // We need to explicitly tell what we expect to be returned.
}

In your case it is a simple fix, add return false at the end of the tests.

public bool activateItem() {
    if (playerCollision == true) {
        if (playerItemScript.curTouchedItem == itemName) {
            if (Input.GetButtonDown("Activate") == true && moveScript.movementEnabled == true) {
                return true;
            }
        }
    }
    return false; // Ok now.
}

Since you are learning, I thought I'd express two different flavors to your approach:

// Don't use if's at all:
public bool activateItem() 
{
    var isCollision = playerCollision == true;
    var isRightName = playerItemScript.curTouchedItem == itemName;
    var isPressed = Input.GetButtonDown("Activate") == true;
    var isMoving = moveScript.movementEnabled;

    var allConditionsMet = isCollision && isRightName && isPressed && isMoving;

    return allConditionsMet;
}

// Use one if instead of three:
public bool activateItem() 
{
    var isCollision = playerCollision == true;
    var isRightName = playerItemScript.curTouchedItem == itemName;
    var isPressed = Input.GetButtonDown("Activate") == true;
    var isMoving = moveScript.movementEnabled;

    if (isCollision && isRightName && isPressed && isMoving) 
    {
        return true;
    }
    else 
    {
        return false;
    }
}

Statement illustrated the problem.

Here are some tips:

It is convention to start function names with a capital letter. Also, putting the word "Script" into a variable should be unnecessary. If your class names are not clear enough, you should rename them, instead of having to clarify that they are "scripts". Chaining if blocks, as you did, is the same thing as using &&, which for some reason, you only did in the last line. I don't like extra indentation, so if all I had to go on was your code, I would do it like this:

public bool ActivateItem() {
    if (playerCollision && playerItem.curTouchedItem == itemName 
        && Input.GetButtonDown("Activate") && move.movementEnabled) return true;

    return false;
}

Generally, however, I would try not to have so many conditions. This sounds like something you're running in Update(), when it would likely be better suited to event handling.