Garry's Mod Wiki

timer.Exists

boolean timer.Exists( string identifier )

Description

Returns whenever the given timer exists or not.

Arguments

1 string identifier
Identifier of the timer.

Returns

1 boolean
Returns true if the timer exists, false if it doesn't

Example

Checks it the timer exists

if ( timer.Exists( "TimerName" ) ) then -- The timer exists print( "The timer exists" ) else -- The timer doesn't exist print( "The timer does not exist!" ) -- Create a timer timer.Create( "TimerName", 1, 0, function() print( "I'm a Timer" ) end) end
Output:
The timer does not exist! I'm a Timer I'm a Timer I'm a Timer I'm a Timer

Page Links


Special Pages


Wikis

?

Render Time: 37ms

DB GetPage 6
Generate Html 3
SaveChanges (1) 14
Render Body 0
Render Sidebar 12