Ability to read Altitude value using Lua?

please can u help me
my script work with simulation but not work with pixhawk 2.4.8
message show
Unable to allocate scripting memory
do u have any idea please

You can try increasing the SCR_HEAP size, but I suspect your autopilot may not have enough memory for the Lua engine.

SCR_HEAP size is very big 64000
and script size is just 366 is very small

I suspect your autopilot does not support scripting then.

how can i ckeck if my pixhawk support or not
where my pixhawk 2.4.8

what do u suggest mr

https://ardupilot.org/copter/docs/common-lua-scripts.html