How to add timer and a new level?

I need help so I can finish my finals. I really need this for school, but idk what to do or how to script it. I’m about to have a breakdown over this thing lol.

I want the game to show game over/try again and can’t proceed to next level if they aren’t able to get all the apples before the timer ends. But if they are able to get all the apples before the timer ends, I want them to proceed to the next level, which I don’t know how to do either. After the second level, the game ends.

What should I add to my script and on my editor to do that? We weren’t taught this part, so I’m quite lost.

Here’s my code so far + how my game looks rn:

Thank you!

Hi @zero2 and welcome!

Please check the topic below about creating a timer.

https://forum.playcanvas.com/t/solved-timer-implementation/

The page below explains how you can change a scene.

https://developer.playcanvas.com/en/user-manual/packs/loading-scenes/