How to create a slider in-script?

Dumb question, but I couldn’t find the answer anywhere…
My question is how do you create a slider that shows an int value in the script itself, something like :
196815-sliderref.png

I tried searching the “Slider”(In-built) script for this, but it was really hard to find anything in it…

You just need to use the Range attribute:

[Range(0, 1)]
float sampleVariable;

More info can be found here: