-- description: gives the option to leave the current level when collecting a "Stay In Level" type star\n\n - by king the memer -- name: Leave level on Star function mario_update(m) if m.playerIndex ~= 0 then return end local STAY_YES_NO = "\nDo you want to Save?\n//You Bet//Not Yet" if get_dialog_id() == DIALOG_013 or get_dialog_id() == DIALOG_014 then if gNetworkPlayers[0].currCourseNum ~= COURSE_NONE then STAY_YES_NO = "\nDo you want to stay?\n//You Bet//No Way" if get_dialog_box_state() == DIALOG_UNK1_AWAIT_DIALOG and get_dialog_response() == 2 then level_trigger_warp(m, WARP_OP_STAR_EXIT) end end end smlua_text_utils_dialog_replace(DIALOG_013, 1, 5, 30, 200, ( "You've collected 100\ coins! Mario gains more\ power from the castle."..STAY_YES_NO)) smlua_text_utils_dialog_replace(DIALOG_014, 1, 4, 30, 200, ( "Wow! Another Power Star!\ Mario gains more courage\ from the power of the\ castle."..STAY_YES_NO)) end hook_event(HOOK_MARIO_UPDATE, mario_update)