Making the mouse wheel increase/decrease a Variable

Well the title explains it, but i’ll tell you anyway. I need to know how to make a variable increase(mouse wheel up) or decrease(mouse wheel down).

What variable?

Is this when a VGUI control has focus or just in the world?

[lua]
local myvar = 0

hook.Add(“Think”, “IncreaseMyVar”, function()
if input.IsMouseDown(MOUSE_WHEEL_DOWN) then
myvar = myvar - 1
elseif input.IsMouseDown(MOUSE_WHEEL_UP) then
myvar = myvar + 1
end
end)
[/lua]

It does now work as well: