Timer:IsPastRealTimeLimit

From Data Realms Wiki

Revision as of 00:46, 28 June 2012 by Beautifybot (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
SyntaxIsPastRealTimeLimit( * An unsigned long specifying the threshold amount of real time in ms. )
Description:
Returns true if the elapsed real time is past a certain amount of time after the start previously set by SetRealTimeLimit.
ReturnsA bool only yielding true if the elapsed real time is greater than the set limit value. If no limit has been set, this returns false.




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