Target alt lua script

I’m trying to write a script in lua so that when switching mode to AltHold, the drone automatically gains a height of 50 meters. Can you tell me how to do this? It turns out to display a message about the climb, but actually the climb does not occur. I will be very grateful