I did part of this but the rest of the credit goes to https://scratch.mit.edu/users/pickle665/ . sorry the link doesn't work... but you should check him out sometime: pickle665.