mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-07 19:42:26 +00:00
clarified variable declaration
parent
afcc284acf
commit
15ff211319
@ -58,9 +58,10 @@ end
|
|||||||
|
|
||||||
```
|
```
|
||||||
-- this is an example of how to track time on an NPC.
|
-- this is an example of how to track time on an NPC.
|
||||||
|
-- time_a is declared local outside of a function to be available later.
|
||||||
|
local time_a = os.time();
|
||||||
|
|
||||||
function event_spawn(e)
|
function event_spawn(e)
|
||||||
-- time_a is declared global to be available later.
|
|
||||||
time_a = os.time();
|
|
||||||
-- os.time(); returns an integer value in seconds.
|
-- os.time(); returns an integer value in seconds.
|
||||||
e.self:Shout("The time is now: "..time_a);
|
e.self:Shout("The time is now: "..time_a);
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user