I'm looking for a clientside stopwatch-type timer, as the title suggests. I don't want it serverside because not everyone that plays on my server will want or need it.
It should be able to be bound to a key, and that key will serve as start/stop. It should count up in seconds on the screen in the top right corner until I press stop, then it should stay on screen for 10 seconds and disappear (or if it is started again, it disappears).
I'm making an obstacle course and I want to time participants, but I don't feel like buying a stopwatch in real life :smug:
I also think this might be a pretty simple script, like a 5 minute or less thing for the experienced scripters.
I'm also looking for something called a ranger, also clientside. It should be bound to a key and when I press the key, it reports the range to my screen and stays there for 3 seconds. I should be able to have 5 ranges listed on screen at once, under each other (as I said, like a list). It should report the range in meters.
The ranger is mostly for novelty but I'm picky and like to know distances on the fly.
Thank you in advance, these would be ultimately valuable to me.
Bumping this, I really want this made.
Bumping again... hope this ain't against the rules...
This sounds like a useful and practical idea! Someone should make this.
Well, even if you would have a stop watch in real life it wouldn't be check for everyone so. It would be useful.
No, I mean a clientside one as the title suggests, so that I could just use it ingame. Stopwatches cost a lot of money in real life, quality ones are around 20 dollars, that's a waste of money honestly.
[code]
-- Stopwatch
local watch = false
local time = 0
local lastpaint = 0
function StopWatchToggle(ply,cmd,arg)
watch = not watch -- simple toggle betwheen true/false
time = CurTime() -- for getting seconds ...
end
concommand.Add("stopwatch",StopWatchToggle)
function StopWatchPaint()
if watch then
lastpaint = CurTime()
end
if lastpaint + 5 > CurTime() then
draw.SimpleText(math.floor(time).." sec.","Default",100,100,Color(255,255,255),1,1)
end
end
hook.Add("HUDPaint","StopWatch",StopWatchPaint)
[/code]
Untested, should work.
Ranger will come later.
autorun/client/stopwatch.lua?
I'll try that for now.
[editline]01:09PM[/editline]
[code]
Hook 'StopWatch' Failed: autorun/client/stopwatch.lua:16: attempt to call field 'DrawSimpleText' (a nil value)
[/code]
It gives me that error once and only once, if I press the button I've bound (or try to run it straight from console) nothing happens. :(
Yeah, the right command would be draw.SimpleText... :3
I fixed the above code, just copy 'n paste it again.
Now it's counting time up from when the map first loaded, but it doesn't display until I run the command "stopwatch," and each time I press it it will update. After like 5 seconds, it disappears, and the next time I press it I find that it has continued to count up.
This could prove useful.
Yeah, that would be great if someone made something like this
Sorry, you need to Log In to post a reply to this thread.