Garry's Mod Wiki

Revision Difference

timer.Remove#519445

<function name="Remove" parent="timer" type="libraryfunc"> <description>Stops and removes a timer created by <page>timer.Create</page>.</description>⤶ <realm>Shared and Menu</realm>⤶ <args>⤶ <arg name="identifier" type="string">Identifier of the timer to remove.</arg>⤶ </args>⤶ <description>Stops and removes a timer created by <page>timer.Create</page>.<warning>The timers are removed in the next frame! Keep this in mind when storing identifiers in variables.</warning>⤶ </description>⤶ <realm>Shared and Menu</realm>⤶ <args>⤶ <arg name="identifier" type="string">Identifier of the timer to remove.</arg>⤶ </args>⤶ </function> ⤶ <example>⤶ ⤶ <description>Removes a timer and clears the identifier.</description>⤶ <code>⤶ timer.Remove(identifier_1)⤶ timer.Remove(identifier_2)⤶ ⤶ -- make sure that the identifier is cleared in the next frame⤶ timer.Simple(0, function()⤶ identifier_1 = nil⤶ identifier_2 = nil⤶ end)⤶ </code>⤶ ⤶ </example>⤶