slider issue

Good day!

I’m a beginner in scripting at least inside blender 2.49. My problem is that when I create a slider and run the script I can move the slider itself but it always jumps back to the default value (1) when it should stay where I left it.

I also have some problems with getting the value from the slider. I suppose the issues are related somehow.

Does anybody have a good example of how to use a slider?