From 15ff21131908c199d0e2fdbe6c00e9a6bc0fa394 Mon Sep 17 00:00:00 2001 From: Sorvani Date: Wed, 24 Jul 2013 21:38:15 -0700 Subject: [PATCH] clarified variable declaration --- Lua-Examples.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lua-Examples.md b/Lua-Examples.md index fb9c5b5..00bd2fd 100644 --- a/Lua-Examples.md +++ b/Lua-Examples.md @@ -58,9 +58,10 @@ end ``` -- 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) - -- time_a is declared global to be available later. - time_a = os.time(); -- os.time(); returns an integer value in seconds. e.self:Shout("The time is now: "..time_a); end