UI.AddCheckbox("Viewmodel in scope")
UI.AddSliderInt("in scope arms transparency", 0, 100)
UI.AddSliderInt("in scope weapon transparency", 0, 100)
UI.AddDropdown("Arms chams in scope", ["Original", "Custom", "Flat", "Pulse", "Wireframe", "Glow", "Glow (two-color)"])
UI.AddDropdown("Weapon chams in scope", ["Original", "Custom", "Flat", "Pulse", "Wireframe", "Glow", "Glow (two-color)"])
UI.AddColorPicker("arms color in scope")
UI.AddColorPicker("arms secondary color in scope")
UI.AddColorPicker("weapon color in scope")
UI.AddColorPicker("weapon secondary color")

Arms_type_cache = UI.GetValue("Visuals", "SELF", "Chams", "Arms type")
Arms_override_cache = UI.GetValue("Visuals", "SELF", "Chams", "Arms override")
Arms_transparency = UI.GetValue("Visuals", "SELF", "Chams", "Arms transparency")
Arms_color_cache = UI.GetValue("Visuals", "SELF", "Chams", "Arms Color")
Arms_second_cache = UI.GetValue("Visuals", "SELF", "Chams", "Arms Color (secondary)")

FWS = UI.GetValue("Visuals", "View", "Field of view")

Weapon_type_cache = UI.GetValue("Visuals", "SELF", "Chams", "Weapon type")
Weapon_override_cache = UI.GetValue("Visuals", "SELF", "Chams", "Weapon override")
Weapon_transparency = UI.GetValue("Visuals", "SELF", "Chams", "Weapon transparency")
Weapon_color_cache = UI.GetValue("Visuals", "SELF", "Chams", "Weapon Color")
Weapon_second_cache = UI.GetValue("Visuals", "SELF", "Chams", "Weapon Color (secondary)")

function ez() {
	if (World.GetServerString() == "")
      return;
	wep_trn = UI.GetValue("Script items", "in scope weapon transparency")
    arms_trn = UI.GetValue("Script items", "in scope arms transparency")
    arms_color = UI.GetColor("Script items", "arms color in scope")
    arms_second = UI.GetColor("Script items", "arms secondary color in scope") 
    weap_color = UI.GetColor("Script items", "weapon color in scope")
    weap_second = UI.GetColor("Script items", "weapon secondary color")
    if(UI.GetValue("Script items", "Viewmodel in scope")) {
    	if(UI.GetValue("Arms chams in scope") == 0) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 6)
    	}
    	else if(UI.GetValue("Arms chams in scope") == 1) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 0)
    }
    else if(UI.GetValue("Arms chams in scope") == 2) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 1)
    }
    else if(UI.GetValue("Arms chams in scope") == 3) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 2)
    }
    else if(UI.GetValue("Arms chams in scope") == 4) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 3)
    }
    else if(UI.GetValue("Arms chams in scope") == 5) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 4)
    }
    else if(UI.GetValue("Arms chams in scope") == 6) {
    		UI.SetValue("Visual", "SELF", "Chams", "Arms type", 5)
    }
}
    if(UI.GetValue("Script items", "Viewmodel in scope")) {
    	if(UI.GetValue("Weapon chams in scope") == 0) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 6)
    	}
    	else if(UI.GetValue("Weapon chams in scope") == 1) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 0)
    }
    else if(UI.GetValue("Weapon chams in scope") == 2) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 1)
    }
    else if(UI.GetValue("Weapon chams in scope") == 3) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 2)
    }
    else if(UI.GetValue("Weapon chams in scope") == 4) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 3)
    }
    else if(UI.GetValue("Weapon chams in scope") == 5) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 4)
    }
    else if(UI.GetValue("Weapon chams in scope") == 6) {
    		UI.SetValue("Visual", "SELF", "Chams", "Weapon type", 5)
    }
}
	UI.SetValue("Visual", "WORLD", "View", "FOV while scoped", 1);
	var local = Entity.GetLocalPlayer();
    scoped = Entity.GetProp(local, "CCSPlayer", "m_bIsScoped");
	if(scoped && UI.GetValue("Script items", "Viewmodel in scope")) {
UI.SetValue("Visuals", "SELF", "Chams", "Arms override", 1)
UI.SetValue("Visuals", "SELF", "Chams", "Arms transparency", arms_trn)
UI.SetValue("Visuals", "SELF", "Chams", "Weapon override", 1)
UI.SetValue("Visuals", "SELF", "Chams", "Weapon transparency", wep_trn)
UI.SetColor("Visuals", "SELF", "Chams", "Arms Color", arms_color)
UI.SetColor("Visuals", "SELF", "Chams", "Arms Color (secondary)", arms_second)
UI.SetColor("Visuals", "SELF", "Chams", "Weapon Color", weap_color)
UI.SetColor("Visuals", "SELF", "Chams", "Weapon Color (secondary)", weap_second)
} else {
UI.SetValue("Visuals", "SELF", "Chams", "Arms type", Arms_type_cache)
UI.SetValue("Visuals", "SELF", "Chams", "Arms override", Arms_override_cache)
UI.SetValue("Visuals", "SELF", "Chams", "Arms transparency", Arms_transparency)
UI.SetValue("Visuals", "SELF", "Chams", "Weapon type", Weapon_type_cache)
UI.SetValue("Visuals", "SELF", "Chams", "Weapon override", Weapon_override_cache)
UI.SetValue("Visuals", "SELF", "Chams", "Weapon transparency", Weapon_transparency)
UI.SetColor("Visuals", "SELF", "Chams", "Arms Color", Arms_color_cache)
UI.SetColor("Visuals", "SELF", "Chams", "Arms Color (secondary)", Arms_second_cache)
UI.SetColor("Visuals", "SELF", "Chams", "Weapon Color", Weapon_color_cache)
UI.SetColor("Visuals", "SELF", "Chams", "Weapon Color (secondary)", Weapon_second_cache)
}
if(UI.GetValue("Script items", "Viewmodel in scope")) {
	Cheat.ExecuteCommand("fov_cs_debug 90")
} else {
	Cheat.ExecuteCommand("fov_cs_debug 0")
}
}
Cheat.RegisterCallback("CreateMove", "ez")

function unload() {
	Convar.SetInt("fov_cs_debug", 0);
	UI.SetValue("Visuals", "View", "Fov while scoped", FWS)
}
Cheat.RegisterCallback("Unload", "unload")