Language:
Lua     Change language:
Pastebin: 117152
Author: ChaosInc
Subject: OnUpdate w/comments
Created: 2009-07-06 22:04:27
Download and save
Toggle line numbers
1function Napkin_OnUpdate(self, elapsed) 
2    if self.delay then -- first check if you have a delay time set already 
3        self.delay = self.delay - elapsed   -- delay time is found, increment it down 
4        if self.delay < 0 then  -- has the timer reached zero? 
5            self.delay = 2 -- reset the timer (or nil it to get rid of it) 
6            MovePlayerFrame()  -- execute your code 
7        end 
8    else 
9        -- no delay set, make one 
10        self.delay = 2 
11    end 
12end 
Thread:
[117152] OnUpdate w/comments by ChaosInc at 2009-07-06 22:04:27
Tip: Click the line numbers to toggle highliting on that line.

Paste followup:

Language:
Author:
Subject:


    Tabstop:     bigger biggest
Note: You can prefix a line with "@@@" to highlight it.