unity script error

hey everybody i’ve got this script from someone but it wont work and i can’t get it to work.

public class Flamable : MonoBehaviour {

public float FireHealth = 50;
public float MaxFireHealth = 50;
public float HealthRegen = 5;
public bool IsOnFire = true;

void OnParticleCollision(GameObject other) {     
   if(IsOnFire) {
     FireHealth -= 1.0f;
     if (FireHealth <= 0) {
      IsOnFire = false;
      transform.GetComponent<ParticleEmitter>().emit = false;
      // other things to do when fire goes out

void Update() {
   if (IsOnFire) {
     FireHealth += Time.deltaTime * HealthRegen;  
     if (FireHealth > MaxFireHealth) {
      FireHealth = MaxFireHealth;


it keeps giving me this error

Assets/Flamable.cs(1,25): error CS0246: The type or namespace name `MonoBehaviour’ could not be found. Are you missing a using directive or an assembly reference?

can anybody please give me the solution of this error?

this is what the person who was so nice to give me this said:

The easiest way would be to use the legacy particle system, so you can add collision detection to the particles.

Set up your particle emitters that will represent the fire hose object emitting water particles and all of the flammable objects emitting fire particles. The legacy system requires you to add a particle emitter, a particle animator, and a particle renderer to the objects (See the menu Components->Effects->Legacy Particles). It doesn’t use a separate GameObject particle system.

Add the World Particle Collider component to the fire hose object and check the “Send Collision Message” box in the inspector. This will let you use the collision in a script.

Next you will need to add a script to the flammable objects you created. I know C# better than javascript so this is in C#. Add the OnParticleCOllision function to the script. In side here you can create a counter that tracks all of the particles that have hit and if it reaches a certain number than you can turn the fire emitter off. In the Update function you can decrease the counter. Think of it like the fires health bar.

i did everything except i kept my original particle effect that was attached to my hoze instead of making a new one.

Do you have this line at the top of the file?

using UnityEngine;