Anything too dry and powdery would be unwelcome, just like grit in our eyes. And powder hurts because it sticks to the slug, making it hard to move on. Irritating substances like salt, acids, or coffee grounds also will stop them. And objects that create electric currents, such as metals in contact, eg copper-zinc bimetals, repel them. Freezing cold and painful heat, or vigorously vibrating surfaces also will work. Most of them also won't walk on oil or water.