Script lua arducopter

Hello, could someone help me with a LUA script to set the PWM of a servo according to the flight mode?