Flylux
|
  |
| Joined: 23 May 2010 |
| Total Posts: 4804 |
|
|
| 09 Jan 2014 12:05 PM |
Can I just ask, what is the difference between a Variable and "local" They seem to do the same thing, clear this up for me? |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 09 Jan 2014 12:05 PM |
local variables are client side variables are server side |
|
|
| Report Abuse |
|
|
Flylux
|
  |
| Joined: 23 May 2010 |
| Total Posts: 4804 |
|
| |
|
Kingmouli
|
  |
| Joined: 28 Sep 2012 |
| Total Posts: 1292 |
|
| |
|
|
| 09 Jan 2014 12:38 PM |
| You probably won't need both. |
|
|
| Report Abuse |
|
|
|
| 09 Jan 2014 02:06 PM |
A normal Variable is accessible by all parts of the script it is in. A local variable is only accsesable by the scope it is in, so:
Hi=1 print(Hi)--prints 1
if true then local Hi=2 print(Hi)--prints 2 end
print(Hi)--prints 1 again
Scope is basically as how tabbed in you are, if you tab as robloxs auto tabbing system works. |
|
|
| Report Abuse |
|
|
feskeral
|
  |
| Joined: 09 Dec 2013 |
| Total Posts: 2729 |
|
|
| 09 Jan 2014 02:07 PM |
| I am not that great but I usually avoid locals because they are problematic for me. |
|
|
| Report Abuse |
|
|