Entered(O)
if(isturf(O))
if(O == turf/Earth/Terrain/Water)//the path to the water it enters
src.underlays += 'watersplit.dmi'//src is the beam.
Exited(O)
if(isturf(O))
if(O == turf/Earth/Terrain/Water)//the path to the water is enters
src.underlays -= 'watersplit.dmi'//src is the beam.
I added comments into the coding to show what everything means.
You should use the istype() proc to check whether or not an object is of a certain type, like this: