@shadethrow
I'm not sure if it's still relevant, but here's a code for X and Y that works. You just need to go to Route 2, stand in the grass, press R + L, and it should appear. I hope the code works — it did for me in Citra. Remember to enter the code in Citra and turn off all other cheat codes to avoid any issues. And don't forget to save your game, just in case.
The cod is for Gastly level 1.
DD000000 00000300
B8CEC554 00000000
C0000000 0000002F
10001414 0000005C
10001416 00000001
DC000000 00000004
D2000000 00000000
I was looking for codes for Pokémon X myself, but I could only find ones for Legendaries and Ultra Beasts. I thought, "Hey, maybe ChatGPT can help me by working together with me to create codes." It was quite a task, but I managed to make many of my favorite Pokémon appear. I kept giving it feedback so it could keep improving based on what spawned, especially if it wasn’t what I was aiming for.
I do pay for ChatGPT, so I don’t hit the usage limit all the time. It takes some time, but it’s definitely possible if you’re patient and ask the right questions. I hope it works for you — and if not, I’d be happy to help if you’re looking for something specific, like Gengar.