notes/Blender 3D Game Move then Rotate Object-KW3UwfBN.sh
import bge

owner = bge.logic.getCurrentController().owner

z=owner.localPosition.z

if z < 5:
    owner.localPosition.z+=.1
    print(z)
else:
    owner.applyRotation([0,0,.1])

syntax highlighted by Code2HTML, v. 0.9.1