chicka123
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 25356 |
|
|
| 06 May 2012 07:28 PM |
Local > Not local? Local < Not local? Local = Not local I know local is another word for client, but I don't understand.. |
|
|
| Report Abuse |
|
|
|
| 06 May 2012 07:58 PM |
Local stuff runs on the Client.
Think of this:
A Teacher is the Server. Students are the Client.
The Teacher tells students to do something. The Students all do it. However, Students also do their own individual stuff.
Your Computer is the "Student" or client when on an online game. The computer hosting that game is the Server.
Things that happen on the Server are usually seen on all clients. Things that only happen on the Client are usually only seen on the client.
Try googling "Server vs. Client" |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 06 May 2012 08:15 PM |
in a script, the term "local" means the variable only exists in the scope it was declared.
for example in a counter function..
a = 0 function count() a = a +1 print("inside count: " .. a) end count() print("after count: ".. a)
the output will be: > inside count: 1 > after count: 1
but if we change it...
a = 0 function count() local a = a +1 print("inside count: " .. a) end count() print("after count: " .. a)
the output will be: > inside count: 1 > after count: 0
since the local variable a only exists inside that function! |
|
|
| Report Abuse |
|
|
|
| 06 May 2012 08:19 PM |
Also (according to the wiki) a local is only equal to the value that you set it in the function that you set it in. It is good for when you have a lot of functions inside one script. For instance, here is an example script:
car = 5 print(car) function change() local car = 10 print(car) end change() print(car)
Output: 5 10 5 |
|
|
| Report Abuse |
|
|
| |
|