-- name: Ticking Time Bomb -- description: The death strikes In 5 mins local gameTimer = 0 local FRAMES_PER_SECOND = 30 local WAIT_SECONDS = 5 * 60 local WAIT_FRAMES = WAIT_SECONDS * FRAMES_PER_SECOND local deathLoopActive = false local function get_local_mario() if gMarioStates and gMarioStates[0] then return gMarioStates[0] end if gMarioStates then for i = 0, #gMarioStates do if gMarioStates[i] then return gMarioStates[i] end end end return nil end local function endless_death() local m = get_local_mario() if m then m.health = 0 m.hurtCounter = 0 end end local function update_timer() gameTimer = gameTimer + 1 if not deathLoopActive and gameTimer >= WAIT_FRAMES then deathLoopActive = true end if deathLoopActive then endless_death() end end local function draw_timer() local totalSeconds = math.floor(gameTimer / FRAMES_PER_SECOND) local minutes = math.floor(totalSeconds / 60) local seconds = totalSeconds % 60 local timeString = string.format("Time: %02d:%02d", minutes, seconds) djui_hud_set_color(255, 0, 0, 255) djui_hud_print_text(timeString, 150, 10, 1) if deathLoopActive then djui_hud_print_text("YOU KEEP DYING!", 120, 30, 2) end end hook_event(HOOK_UPDATE, update_timer) hook_event(HOOK_ON_HUD_RENDER, draw_timer)