Your first wait() loop will never end. The second one (which rotates your image) won’t ever run.
Break out of the first while wait() loop. Also, use task.wait() instead.
If you need to do both at the same time, consider using coroutines or task.spawn().
The code is correct, here is some tips that could possibly help you:
Make sure that the image is actually visible on the screen, and that it’s not hidden or covered by other objects.
Check if the “TurningIcon” object actually exists in your game. You may need to double-check the spelling and capitalization of the object’s name.
Ensure that the script is actually running. You can add a print statement at the beginning of the script to check if it’s being executed.
If the image is a child of another object, make sure that the “Rotation” property is enabled for that object. You can do this by selecting the object in the Explorer window and checking if the “Rotation” property is present in the Properties window.