Skip to main content

ui.new_slider

Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.

ui.new_slider(tab: string, container: string, name: string, min: number, max: number, init_value: number, show_tooltip: boolean, unit: string, scale: number, tooltips: table): number

Arguments

NameDescriptionType
tabThe name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.string
containerThe name of the existing container to which this control will be added.string
nameThe name of the slider.string
minThe minimum value that can be set using the slider.number
maxThe maximum value that can be set using the slider.number
init_valueInteger. The initial value. If not provided, the initial value will be min.number
show_tooltipBoolean. true if the slider should display its current value.boolean
unitString that is two characters or less. This will be appended to the display value. For example, "px" for pixels or "%" for a percentage.string
scaleThe display value will be multiplied by this scale. For example, 0.1 will make a slider with the range [0-1800] show as 0.0-180.0 with one decimal place.number
tooltipsTable used to override the tooltip for the specified values. The key must be within min-max. The value is a string that will be shown instead of the numeric value whenever that value is selected.table

Returns menu item: number