Getscore and sound and generate random function