Timer:IsPastSimMS

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
DrLuke (Talk)
(Fixing a little mistake in the code)
Newer edit →

Revision as of 01:56, 4 September 2009

Function
SyntaxTimer:IsPastSimMS( number Time in milliseconds )
Description:
This function will check, whether a certain time has passed after the timer has been created.
Returnsnil




Example
DescriptionThis will gib the object this script is attached to after 5 seconds have passed.
Code
  1. function create(self)
  2.     self.LTimer = Timer(); --this is needed for "Timer:IsPastSimMS" to work.
  3. end
  4.  
  5. function update(self)
  6.     if Timer:IsPastSimMs(5000) == true then --checks if 5 seconds (5000 milliseconds) have passed
  7.         self:GibThis(); --if 5 seconds have passed, gib(kill) the object!
  8.     end
  9. end
Outputnil
Personal tools