I don't know if it's possible to check what terrain type is touched, but if so, would this be to check?
script.Parent.RightLeg.Touched:connect(function(hit) if hit.Material == Enum.Material.Slate then -- stuff end end)
GetCell()
CellMaterial, CellBlock, CellOrientation GetCell ( int x, int y, int z ) Returns the material, type, and orientation of grid cell (x, y, z).
^From the wiki
You could call that method when your character is touching the Terrain, and getting the Cell doing Character.Torso.Position.Y-4 or something.
GetCell() will return the Material of the Cell.
If you're not aiming for game terrain, then this should do:
script.Parent.RightLeg.Touched:connect(function(hit) print(script.Parent.Name .." has touched ".. hit.Material) --Easy fix, just be sure to have the Output window open in studio. (Found in the View tab.) end)
Hope that helps!