descending problem

I don’t know how to explain it in the title/in a few words.

mTime = 0
function mdescend()
if mheight != 36 then
mheight = mheight+1 --THIS IS THE LINE IN QUESTION
Menu:SetPos( mwide, mheight )
elseif mheight == 36 then

			mTime = CurTime()+1
		hook.Add( "Think", "descend", mdescend )

ok, so this works fine. the menu descends slowly and stops at it’s destination height, 36. I was happy at first but then I started thinking, what if people don’t like how slow it goes. and for big menus, it’s going to take a while for the menu to descend entirely. so I tried changing: [lua]mheight = mheight+1 --LINE 4[/lua] which is what makes it move, to something like [lua]mheight=mheight+2.5 --LINE 4[/lua] which makes it descend faster, but it doesn’t stop at it’s destination height of 36. The menu just keeps going and does not stop at all. If the + value isn’t 1 it doesn’t stop at the destination point, and I don’t know how to fix this.

[editline]27th June 2011[/editline]

unless curtime+x needs to be the same as the height+x, idk how to fix

[editline]27th June 2011[/editline]


Use ‘if mheight < 36 then’?

o well maybe leme try

[editline]27th June 2011[/editline]

ye that fixed it, ty

[editline]27th June 2011[/editline]

problem was it was skipping over 36