ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. guiCreateSlider

Function

guiCreateSlider

ClientInterface (GUI)Trilogy Hub only

Creates a value slider 0-100. Changing it fires onClientGUIChanged.

Syntax

gui-slider guiCreateSlider(float x, float y, float width, float height, bool relative [, element parent = nil])

Arguments

xfloat
X position.
yfloat
Y position.
widthfloat
Width.
heightfloat
Height.
relativebool
Relative values.
parentelement, optional = nil
Parent.

Returns

The slider.

Example

local slider = guiCreateSlider(20, 20, 260, 24, false)
guiSliderSetValue(slider, 50)
addEventHandler("onClientGUIChanged", slider, function()
    setSoundVolume(music, guiSliderGetValue(slider) / 100)
end, false)

See also