Right now I can only set health variable each time I press mouse button somehwere on the panel:

Code:
...
function set_health()
{
	if (health != max_health)
	{
		health = max_health;
		win_x = (health_width*health)/max_health;
		win_x = health_width - win_x;
	}
}

...

PANEL* my_panel =
{
...
hslider(30,117, 148, s_slider, 10, 200, max_health);
	
	on_click = set_health; //Hiirenupu vajutusel muudame elud samaks kui max_health
...
}


But how can I change health to max_health only when I have pressed the mouse button from slider?


New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK