Time Function in Javascript?

Is there a function that makes it so after a certain amount of seconds it will trigger an event? Im trying to make a scene where the robot runs over a trigger, starts an audio clip lasting 40 seconds and after the 40 seconds opens a door behind the player. Some thing like

Function Time(40);

Is that what it is? That was just a wild guess. Thanks for your replys.

Use Invoke for delayed invocations of methods. For example:

Invoke ("FunctionName", 40);

For more information, see the documentation of Invoke.