How to make a enemy like lakitu from mario

I’m trying to create a character that flys, randomly stops, drops an object, and continues flying like Lakitu from Mario but not right above to character.