While you can absolutely write scripts that contain functions and loops to do all sorts of cool stuff in Blender, it’s important to note that it’s not a game engine and does not play by the same rules that you might expect if you’re coming from Unity or Unreal. Because there is no gameplay mode, the concept of events doesn’t really apply.