function onBegin()

  if getFlag("deadtambem") then

    disablePause()
    disableMovement()
    setFlag("stopmusic1")
    wait(1.5)

    walk(-20)
    wait(1.5)

    walk(20)
    wait(1.5)

    walk(-10)
    wait(1.5)

    player.DummyAutoAnimate = false
    player.Sprite:Play("newdeath", false, false)
    wait(3)

    blackscreen = celeste.Mod.MaxHelpingHand.Entities.MoreCustomNPC.GetNPC("blackscreen")
    blackscreen.Position = vector2(160, 7330)
    wait(3.5)
    player.DummyAutoAnimate = true
    wait()

    setFlag("enddoor1")
    enableMovement()
    enablePause()

  end

end