-- name: FOV Config -- description: FOV Config v1\nAllows you to config the game's Field of View via a Mod Menu Slider.\n\nMade by: Squishy6094 -- category: qol utility local FOV_MIN = 30 local FOV_DEFAULT = 45 local FOV_MAX = 120 local configFov = math.clamp(mod_storage_load_integer("configFov", FOV_DEFAULT), FOV_MIN, FOV_MAX) -- Overwrite Lua API function to be compatible local og_set_override_fov = set_override_fov _G.set_override_fov = function(fov) og_set_override_fov(configFov * (fov/45)) end local function update() og_set_override_fov(configFov) end local function set_fov_slider(_, value) configFov = value mod_storage_save_integer("configFov", configFov) end local function set_fov_message(msg) if msg == string.lower("default") then msg = 40 end value = tonumber(msg) if value ~= nil then configFov = math.clamp(math.round(value), FOV_MIN, FOV_MAX) mod_storage_save_integer("configFov", configFov) update_mod_menu_element_slider(fovSliderIndex, configFov) djui_chat_message_create("Field of View set to " .. tostring(configFov)) return true else djui_chat_message_create("Field of View must be a number!") return true end end hook_event(HOOK_UPDATE, update) hook_mod_menu_text("Made by: Squishy6094\nDefault Field of View: "..tostring(FOV_DEFAULT)) fovSliderIndex = hook_mod_menu_slider("Field of View", configFov, FOV_MIN, FOV_MAX, set_fov_slider) hook_chat_command("fov", "Sets the Field of View, Default is "..tostring(FOV_DEFAULT), set_fov_message)