// this function does the actual level changing
function levelchange_event()
{
wait(1); // always do this before level_load to give running functions time to end
freeze_mode = 1; // pause while changing levels
level_load("level2.wmb"); // change the name to an actual map in your project
wait(1);
freeze_mode = 0; // unpause
}
// attach this following action to an object via WED
// this action monitors whether the thing was clicked on, and if so, calls the above function
action level_changer()
{
my.emask |= ENABLE_CLICK;
my.event = levelchange_event;
}