Tell us exactly what you’re trying to accomplish - there may be a better way to do it.
For example, I had someone ask me a similar question in order to remove a weapon from someone who picked it up and they used Tick / Think or timer when it could be accomplished using a hook which is called when the weapon is picked up ( not to mention the weapons can be deleted as soon as they are spawned ) and there are hooks that are called when the player switches to the weapon…
timers aren’t reliable from my experience - unless they have been corrected… Another way to accomplish having something run ~10 times per second would be to have a simple think hook:
//
// Think Hook to run something approx. 10 times per second...
//
local CFG_LogicInterval = 1 / 10; -- Interval in seconds, ie 10 times per second..
local __NextLogicTime = 0; -- Internal value - do not edit..
hook.Add( "Think", "Run~10xPerSecond", function( )
// If the time-difference between the current time and our next-scheduled execute-logic-interval is 0 ( because tick is executed ~33 times per second by default, if 0 then time is up anyway ) or higher then execute the logic
if ( CurTime( ) - __NextLogicTime >= 0 ) then
// Update our clock... so it'll run the logic within 1 / 10 seconds from now...
__NextLogicTime = CurTime( ) + CFG_LogicInterval;
// Run the logic...
-- print( "printing is expensive, don't do this unless debugging.." );
end
end );
If timers have been fixed, then it should be fine - just remember if you’re running tests on your local SRCDS and you haven’t joined, you will need to join or have a bot join to let timers and CurTime / Time to start…
But, again, there may be a better way to whatever it is you’re trying to accomplish - why not explain what you’re trying to do - there may be better suggestions.