This is an easy method, but not the best.
-
create an own game instance class
-
go to project settings->map and modes
-
set the game instance class to the new created
-
Add a custom event to the game instance class (you need to put a delay after open
level, because the level needs some time to load, otherwise the next code would instantly execute so that it wouldnt work.
- call the function when ever you want