How can I do to spawn an object?

I want to know how to spawn spikes when the player hits a certain block

Use the spawn behavior. Take a look at the documentation to see how it works:
https://flowlab.io/behavior_handbook/#components-spawn

thanks!