[0.17.60] LuaGuiElement of type 'slider' property 'value' can be set on add
Posted: Sun Aug 18, 2019 10:22 am
When adding a gui element of type slider the property value must be set in order to have a starting value for the slider, slider_value doesnt work. But later value cannot be accessed at all. You have to use slider_value which actually has the value previously set using the property value. This is inconsistent. And the documentation is clear on the difference between value and slider_value.
I expect to always use slider_value for gui elements of type slider.
Examples:
This works:
But this produces an error:
You have to (correctly) use:
Which will print 4.
I expect to always use slider_value for gui elements of type slider.
Examples:
This works:
Code: Select all
local my_slider = element.add {
type = "slider",
name = "output-count-slider",
minimum_value = 1,
maximum_value = 8,
value_step = 1,
discrete_slider = true,
discrete_values = true,
value = 4 -- I expect to use slider_value instead here.
}
Code: Select all
player.print(my_slider.value)
Code: Select all
player.print(my_slider.slider_value)