Code:
const int linkfalling = 0; // set here the first tile of your 5 tile Link Falling animation
const int linklava = 0; // set here the first tile of your 5 tile Link Drowning animation
const int fallingsfx = 0; // set here the SFX that plays when Link falls
const int lavasfx = 0; // set here the SFX that plays when Link drowns in lava
const int invis = 0; // set here the item ID of an item with Link Tile Modifier to make Link completely invisible

ffc script hole{
    void run(int lava, int warpx, int warpy, int combotype, int tile){    
        int sfx = fallingsfx;
        if(warpx == 0 && warpy == 0){Waitframes(5); warpx = Link->X; warpy = Link->Y;}
        if(tile == 0){tile = linkfalling;}
        if(combotype == 0){combotype = 35;}
        if(lava != 0){if(tile == linkfalling){tile = linklava;}sfx = lavasfx;}
        int timer; bool switch;
        int x; int y; bool falling;

        while(true){
            if(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0){
                if(Link->Action != LA_FROZEN && !falling){
                falling = true;
                }
                while(falling && Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0 && timer < 5){
                    timer++;
                Waitframe();
                }
                for(timer = 0; timer < 40; timer++){
                    if(!switch){Game->PlaySound(sfx); switch = true; x = Link->X; y = Link->Y;}
                    Link->Item[invis] = true;
                    Link->Action = LA_FROZEN;
                    if(lava == 0) Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                    else Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                Waitframe();
                }
                switch = false;
                Link->Item[invis] = false;
                Link->X = warpx; Link->Y = warpy;
                Link->Action = 0;
                Link->HP -= 8;
                Game->PlaySound(19);
            }
        Waitframe();
        }
    }
}
Make sure to set the Constant Integers at the beginning, and also to include them into the script file.

Arguments:
D0: If D0 is equal to '0', the script makes pits. If D0 is not equal to '0', the script makes lava.
D1 && 2: D1 && 2 are the coordinates to have Link re-spawn at after falling into a pit. If left at 0, he will respawn where he entered the screen.
D3: The combotype for 'Pit' combos. If left at '0', they will be 'centre statue' combos, by default.
D4: The tile to be used for the 'Link Falling' animation. If left at '0', the ones set in the integers are the beginning will be used.