Creating a simple scrollbar

I’m new to Unity and have looked thoroughly for a tutorial for making simple scrollbars in C# but I can’t find any. I tried using the documentation but I can’t get it to work.

Basically what I want is to create a lone scrollbar anywhere on the screen that I can use. Here’s the code that I’ve got so far:

void OnGUI () {
		float health = 50;
		float maxHealth = 100;
		float dummy = 0;

		GUI.HorizontalScrollbar (Rect (25, 25, 120, 20), dummy, health, 0, maxHealth);
	}

Any help would be greatly appreciated.

hay try this.