Confirm Button for Slider Controls

I have created a vertical slider, but finding it difficult to control the selected value from the slider. I want to create a confirm button to check whenever the player hits the slider value and once the user confirm it, using that slider value. Once the confirmed value has been used, making it to the default.

I’m stuck at this particular situation, and can’t proceed. Anybody there to help?

Use something like this: (JS HERE)

var final_output = 0;
var temp_output = 0;

temp_output = GUI.Slider(… ,temp_output);
if(GUI.Button(… ,“confirm?”)){
final_output = temp_output;
}

Thanx dvdidunis… I will try to execute this in the game, see if it works!!