(pls helppp me ) How to make npc move only in axis z?

3077937--231628--upload_2017-5-21_11-25-21.png

How to make npc move only in axis z?
By entering the coordinate between 50 to -30 as boundary point
btw, i use AIPath from arongranberg.com to make npc follow a target (white) ,but i don’t know how to input the coordinate in script to make boundary point.
plis help me
(sorry for my bad english)

thank you.

“Freeze position” checkbox on rigidbody.