Friction Script

Hello,everybody! Recently, I'd like to simulate the friction process of the material. But I found that I need a script to realize that fuction. Can you provide me a corrresponding script? Thanks a lot.