World hop method works fine.
Some issues with your code.
No sleep condition. Your return value is 0. You are running hundreds of loops a second... A script should run like 1 loop a second.
If you had a condition sleep, you would only run 1 loop for like 3-4 seconds