If you're new to rooting, I recommend getting a cheap throwaway phone which has Android OS 4 or below. I have two phones rooted - an oldSamsung Galaxy model running Android 2.3.6 (not one of the Galaxy S range) and a Huawei Ascend Y330 running Android 4.4. These are phones that are easily replaceable as they are so old.
Why Android OS less than Lollipop? Because you will find the one touch root apps such as Kingroot, 360 root etc work much better with Android 4.4 or less. Once you learn more about rooting there are much better options to root.
These cheap phones allow me to create modded system apk's from Lucky Patcher safe in the knowledge if I mess up I can throw the phones away and not be too downhearted. Don't know too much about Moto X but if it's the same as my Moto G, you will have to unlock the bootloader first and that means going to Motorola and request them to unlock it. There was an app where you had to pay a fee of around $20 and the devs would try to unlock it for you but no way would I trust anyone to access my phones remotely and mess with bootloader s.