taking damage when falling

So I want to make my game so that if you fall from a certain height you will die, I would like to use this when falling from structures and such, but I would also like to use it for falling off the edge of the terrain, does anybody have a script I can please use?

–Eric