For the first coin, don't jump on it, be on the ground when you hit it. Press the flag twice, so it doesn't glitch.
Thanks to HD123 for the gravity mechanic, Heres a link to their tutorial. https://scratch.mit.edu/projects/1343219/ I made most of this from SCRATCH, although I did use the sound Library and the gravity mechanic.