UI.AddCheckbox("Custom scope fov")
UI.AddSliderInt("Custom scope fov val", 50, 150)
UI.AddSliderInt("Old fov", 50, 150)

function setenabled() {
    if (UI.GetValue("Script items", "Custom scope fov")) {
        UI.SetEnabled("Custom scope fov val", true)
        UI.SetEnabled("Old fov", true)
    } else {
        UI.SetEnabled("Custom scope fov val", false)
        UI.SetEnabled("Old fov", false)
    }
}

function scopefov() {
    var me = Entity.GetLocalPlayer();
    var isScoped = Entity.GetProp(me, "CCSPlayer", "m_bIsScoped");
    if (UI.GetValue("Script items", "Custom scope fov")) {
        if (Entity.IsAlive(me) && (isScoped)) {
            UI.SetValue("Visual", "WORLD", "View", "Field of view", UI.GetValue("Script items", "Custom scope fov val"))
        } else {
            UI.SetValue("Visual", "WORLD", "View", "Field of view", UI.GetValue("Script items", "Old fov"))
        }
    }
}
  
function onDraw() {
    setenabled();
    scopefov();
}

Cheat.RegisterCallback("Draw", "onDraw")