friction now in lua function