You have over complicated this script. This script is also very messy. Thumbs up for trying but for overall structure, it's a thumbs down.
Whats complicated about this script? And whats messy?
Whats complicated about this script?
And whats messy?