2 Replies
OWEN HOLT

Are you talking about a typical web page alert box?

In SL, set a variable called Exit_Course with a default value of "False".

Execute the following JS based on your triggering action.

let player = GetPlayer();

function myFunction() {
     if (confirm("You are about to exit the course!")) {
     player.SetVar("Exit_Course",true);
    } else {
    console.log("User Cancelled Exit!");
    }
};
myFunction();

In SL, add an action to EXIT COURSE when the VARIABLE Exit_Course changes IF Exit_Course is equal to True.

So basically, the JS controls the variable and the variable controls the exit function in SL.