Help converting Godot 2 shader to Godot 4

Ver 4.2

I’m not good with shaders in the slightest and I’m trying to convert this

// Brightness (less than 1 is darker, above 1 is brighter)
uniform float brightness = 1.13;

// Get pixel color from screen
color pixel_color = vec4(texscreen(SCREEN_UV), 1);

// Get pixel color from texture (set on the TextureFrame)
vec4 grid_pixel_color = tex(TEXTURE, UV);

// If the pixel color from our grid image is dark, set it to be fully transparent
if(grid_pixel_color.r < 0.5) {
    COLOR = vec4(1,1,1,0); // (red, green, blue, alpha-transparency)
} else { // Since it is NOT dark, we adjust the pixel color brightness
    COLOR = pixel_color * brightness;
}

Godot 2 Shader to get a gameboy style grid to Godot 4
shader_type canvas_item;
uniform float brightness = 1.13;

void fragment() {
    // Called for every pixel the material is visible on.
    COLOR pixel_color = vec4(texscreen(SCREEN_UV), 1);

    // Get pixel color from texture (set on the TextureFrame)
    vec4 grid_pixel_color = tex(TEXTURE, UV);

    // If the pixel color from our grid image is dark, set it to be fully transparent
    if(grid_pixel_color.r < 0.5) {
        COLOR = vec4(1,1,1,0); // (red, green, blue, alpha-transparency)
    } 
    else { // Since it is NOT dark, we adjust the pixel color brightness
        COLOR = pixel_color * brightness;
        }
    }

, but I currently have an error where it’s saying that I need to add a semicolon on line 6 [COLOR pixel_color = vec4(texscreen(SCREEN_UV), 1);]
could someone tell me what I’m doing wrong

I found the original video you got this from and fixed it. I think it works like it does in the video now, but I didn’t watch the whole thing.

shader_type canvas_item;

uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
uniform float brightness = 1.13;

void fragment() {
    // Called for every pixel the material is visible on.
    vec4 pixel_color = texture(screen_texture, SCREEN_UV);

    // Get pixel color from texture (set on the TextureFrame)
    vec4 grid_pixel_color = texture(TEXTURE, UV);

    // If the pixel color from our grid image is dark, set it to be fully transparent
    if(grid_pixel_color.r < 0.5) {
        COLOR = vec4(1,1,1,0); // (red, green, blue, alpha-transparency)
    } 
    else { // Since it is NOT dark, we adjust the pixel color brightness
        COLOR = pixel_color * brightness;
        }
    }

well the brightness part works, the grid however does not, since values between white and black get mapped as either white or black and do not keep the original shade

What do you mean? Pixels that are dark become transparent.