I am using this for my upcoming Top Hat Tom Part 2. You can remix this but please give credit.
Most of this code is from @ Rish_Studios 's https://scratch.mit.edu/projects/428319655/ but I changed it for 2 player.