> ## Documentation Index
> Fetch the complete documentation index at: https://luau.limerence.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Overrides

> Force a control's value without changing what the UI shows.

`handle:OverrideValue(value, priority?)` forces a control to *act as if* it has a certain value, without changing what the user sees in the menu. Whatever the user picked still shows in the UI; the rest of Limerence reads your value instead.

Use this when you want to temporarily turn a feature on or off (or push a slider somewhere) without fighting the user's own setting.

* The higher the `priority`, the more it wins. Default is `0`.
* Multiple overrides can be active at once. When the highest-priority one is released, the next-highest takes over.
* A bolt icon appears next to the control's name while any override is active. Hovering it tells the user which script is doing it ("My Script is overriding this value.").

Also documented on [ElementHandle](/ui/classes/element-handle#overridevalue).

## OverrideHandle

The handle you get back lets you change or undo the override.

```luau theme={null}
override:Release()              -- undo the override
override:IsReleased()           -- true if already released
override:GetValue()             -- current forced value
override:SetValue(newValue)     -- change the forced value
override:GetPriority()          -- current priority
override:SetPriority(newPrio)   -- change the priority
```

## On unload

You don't have to call `:Release()` yourself. Every override you make is released automatically when your script unloads.

## Example

```luau theme={null}
local trigger = api.ui.find("legitbot.trigger.enabled")
local force = trigger:OverrideValue(true, 50)

-- Later, when your condition expires:
force:Release()
```

## Example: change priority based on game state

```luau theme={null}
local fovEl = api.ui.find("legitbot.aim.fov")
local fovOverride = fovEl:OverrideValue(180, 10)

-- Boost the priority while some flag is true, then drop it back when false.
local active = false
api.utility.connect(SomeSignal, function(state)
    if state and not active then
        fovOverride:SetPriority(100)
        active = true
    elseif not state and active then
        fovOverride:SetPriority(10)
        active = false
    end
end)

-- No need to clean up, it's released for you when the script unloads.
```
