Timer:LeftTillSimTimeLimitS

From Data Realms Wiki

(Difference between revisions)
Jump to: navigation, search
Beautifybot (Talk | contribs)
(updating function page)
Newer edit →

Revision as of 00:46, 28 June 2012

Function
SyntaxLeftTillSimTimeLimitS( * None. )
Description:
Returns how much time in ms that there is left till this Timer reaches a certain time limit previously set by SetSimTimeLimitS.
ReturnsA unsigned long with the sim time left till the passed in value, or negative if this Timer is already past that point in time.




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