Select an accessory from the dropdown list. Use the on-screen arrows or your keyboard (WASD + Q/E for depth) to push the hat. The "new" scripts often include a "Glue" button—click this to lock the hat in place so it doesn't reset when you run.