Mouse global position is not correct

sounds like you are warping the mouse to the mouse’s position. This probably won’t result in any movement or locking.

Make sure to paste your scripts rather than screen shots