RollDownWindow/RollUpWindow help

Hey, im trying to do a script, that lets you roll down/up all windows individually.
With RollDownWindow/RollUpWindows you can address each window by the window index (0-3).
If i roll down a specific window, its rolls every windows down. If i roll one up, nothing happens.

Can someone help?
There are no errors in the debug and server console.

AddEventHandler("bf_carWindowDown", function(window)
    local playerPed = GetPlayerPed(-1)
    if IsPedInAnyVehicle(playerPed, false) then
        local playerCar = GetVehiclePedIsIn(playerPed, false)

        if window == "rfront" then
            RollDownWindow(playerCar, 0)
        elseif window == "lfront" then
            RollDownWindow(playerCar, 1)
        elseif window == "rback" then
            RollDownWindow(playerCar, 2)
        elseif window == "lback" then
            RollDownWindow(playerCar, 3)
        else
            RollDownWindow(playerCar, 0)
            RollDownWindow(playerCar, 1)
        end
    else
        TriggerEvent('chatMessage', "Error", {255, 255, 255}, "You are not inside a vehicle!")
    end
end)

RegisterNetEvent('bf_carWindowUp')

AddEventHandler("bf_carWindowUp", function(window)
    local playerPed = GetPlayerPed(-1)
    if IsPedInAnyVehicle(playerPed, false) then
        local playerCar = GetVehiclePedIsIn(playerPed, false)

        if window == "rfront" then
            RollUpWindow(playerCar, 0)
        elseif window == "lfront" then
            RollUpWindow(playerCar, 1)
        elseif window == "rback" then
            RollUpWindow(playerCar, 2)
        elseif window == "lback" then
            RollUpWindow(playerCar, 3)
        else
            RollUpWindow(playerCar, 0)
            RollUpWindow(playerCar, 1)
        end
    else
        TriggerEvent('chatMessage', "Error", {255, 255, 255}, "You are not inside a vehicle!")
    end
end)
1 Like

Should be fixed in the latest update that has applied 204dbca.

So just wait (a few days) for the client update and it will be fine?
Thanks radon!

Edit:
Just seen that the update is already out. :slight_smile:
Works perfectly now!

so this works without anything addition to the server.

In theory yes.
I trigger the events from the server, because i use this as chat command.

Can you make those commands into a script?
i’m new in these things so xd