Spawning a prop where the player is looking

I need help making a script where the player can spawn a prop a limited distance in front of them. I already have the spawn menu set up but I don’t want the prop to spawn as soon as they press the button, I want them to have the ability to choose where it spawns, like when you spawn a prop using the tool gun.

Here’s an example of spawning a prop in front of a player ( second function ). I should have another somewhere, but this should at least help you get started:

Thank you, I will tweak this to fit my needs.