I am in the process of making some HUD indication that has to show the progress of a given action.
My aim is basically the same as the lockpick from DarkRP - which has a progress bar as you pick a lock.
My initial thinking was something like this:
function progressBar () draw.RoundedBox(0,ScrW()/2,ScrH()/2,200,50,Color(40,40,40)) local lastTime = CurTime() while CurTime()-lastTime < 199 do draw.RoundedBox(0,ScrW()/2,ScrH()/2+1,CurTime()-lastTime,48,Color(255,0,0)) end end hook.Add("HUDPaint", "progress bar HUD element", progressBar)
That, however, doesn’t seem to work. Has anyone got any nice way of doing something like this?
Sorry if you don’t understand my aim here.