how to make a function from a different script happen after another one is done

have hard time

You can choose 2 ways:

The first script have the reference of the second and call the second function at the end.

Or, I preferer this way, You can set an event an call it at the end of your function so every object registred to it start your function.