i don't now what is wrong

Hi,

Here is the console picture with error:

Here is the code:

using UnityEngine;
using System.Collections;

public class Money : MonoBehaviour
{
	int Dinero;
	
	public void DineroFunc(int value)
	{
	 	return Dinero = Dinero + value;
	}
	
	public void OnGUI () 
	{
    	GUI.Label (new Rect (10, 10, 100, 20), "Money: "+ Dinero);
	}
}

The other one:

using UnityEngine;
using System.Collections;

public class add : MonoBehaviour
{

	 Money Dinero;
		int numero = Random.Range(10,500);
	// Update is called once per frame
	void Update ()
	{
		GameObject.FindGameObjectWithTag("Player").GetComponent(Money);
	}
	
	void OnMouseUp()
	{
		if(gameObject.tag == "Oro")
		{
			Dinero.DineroFunc(numero);
			Destroy(gameObject);
		}
	}
	
}

Two things:

Your method is of type void so you can’t return a value from it.
You’re trying to do an assignment and return it at the same time. Just do the assignment or change the void to int and drop the assignment.

I do but now i have this error: