|
| 14 May 2015 02:42 PM |
local Part = Transparency = 0.5
I'm trying to learn how to script, but i'm stuck on the "local" command. I'm learning by the wiki, and I just can't seem to learn how to do it. I know what it's supposed to do, but how to do it I dunno. I've tried similar ways like the command above, but it won't work. Just need to know the structure of it, which I can't seem to get.
Thanks :D |
|
|
| Report Abuse |
|
|
|
| 14 May 2015 02:43 PM |
local Part = workspace.Part Part.Transparency = 0.5 |
|
|
| Report Abuse |
|
|
|
| 14 May 2015 02:44 PM |
Part.Transparency = 0.5
You aren't declaring a variable. local is for declaring variables, for example
x = 5 --This is global
local x = 5 --This is local |
|
|
| Report Abuse |
|
|
| |
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 14 May 2015 02:45 PM |
Well, maybe it is the way that is written.
local Part = Transparency = 0.5 will not work because you can't declare the name of the property.
But, if you try this, it will work.
local thing = 0.5 Part.Transparency = thing
This works because you are just saying the property's value. |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 May 2015 03:12 PM |
| I wouldn't even worry about the scope of a variable until you know what a variable is |
|
|
| Report Abuse |
|
|