Is there any way to get a delay in a function

Please take a look on this → Macros | Unreal Engine Documentation

You’ll find exactly how to have input and output with macro. You have a LOT of image that explain exactly how it work.