Brick breaking help

Howdy I’m trying to make a Mario game and I need help trying to destroy a tile/replace function but I don’t know how to if anyone knows pls respond

i just made this to show you how you can brake bricks and i saw that the lucky blocks did nothing so i coded that to so you could see

just copy the code

you shouldnt really do this. it should only break bricks if the player y velocity is less than 0 (thats the only problem)