"var disable_z_glide = 1" in the main function would just create a local var named "disable_z_glide".

"disable_z_glide = 1" without the "var" in the main function is what you probably meant.