You didn’t really tell us what you mean by “won’t work”… [Do you get an error? Is the text not changing? Is the text not showing up?] but here are some possible fixes:
Make sure you have this line in the top of your code:
import UnityEngine.UI;
You also don’t need to write UnityEngine.UI.Text, just use the type “Text”:
var oofcounter : Text;
Don’t forget to drag the GameObject “oofcounter” into the slot of the variable “oofcounter” in the inspector, as well. You have to reference it.