m
→Proper Use Example
| Line 25: | Line 25: | ||
-- Functions Section | -- Functions Section | ||
function MyAddon_OnUpdate(elapsed) | function MyAddon_OnUpdate(elapsed) | ||
this. | this.TimeSinceLastUpdate = This.timeSinceLastUpdate + elapsed; | ||
if (this. | if (this.TimeSinceLastUpdate > MyAddon_updateInterval) then | ||
-- | -- | ||
-- Insert your OnUpdate code here | -- Insert your OnUpdate code here | ||
-- | -- | ||
this. | this.TimeSinceLastUpdate = 0; | ||
end | end | ||
end | end | ||