|
| 09 Aug 2012 04:58 PM |
| anyone can tell me what are the Variables and what is it for and explain it for me? |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Aug 2012 05:03 PM |
Basically they are shortcuts. For example, if you tired writing the same things over and over you can use a variable like:
script.Parent.Transparency = 0 script.Parent.Transparency = 0.1 script.Parent.Transparency = 0.2 ..etc
You can shorten it with:
Brick = script.Parent Brick.Transparency = 0 Brick.Transparency = 0.1 ...etc
Though, with the same example, that could be further shorten with a "for loop".
Brick = script.Parent for i = 0, 1, 0.1 do --i is the iterator variable, starts at 0, ends at 1, and goes in increments of 0.1 Brick.Transparency = i wait(0.1) end
For more help:
http://wiki.roblox.com/index.php/In-Depth_Scripting_Guide#Variables http://wiki.roblox.com/index.php/Loops#For
† KMXD † |
|
|
| Report Abuse |
|
|
| |
|
zakary99
|
  |
| Joined: 19 Jan 2010 |
| Total Posts: 1095 |
|
|
| 09 Aug 2012 05:04 PM |
Variables are like simplifying something. For example: for i=0.01, 1, 0.01 do -- i is the variable. The letter i is the variable.
Or
zak=game.Lighting.Map zak:Clone().Parent=game.Workspace
~If you value your existence, there's one thing you never ever put in a trap... Me!~ |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 05:06 PM |
| @KnightmareXD thanks for helping me im trying to learn scripting |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2012 05:07 PM |
You're welcome. Sorry for the occasional grammatical mistakes, I forgot to check over my typing. :P
† KMXD † |
|
|
| Report Abuse |
|
|
zakary99
|
  |
| Joined: 19 Jan 2010 |
| Total Posts: 1095 |
|
|
| 09 Aug 2012 05:18 PM |
Knightmare, we keep coming by eachother in this forum. xD
~If you value your existence, there's one thing you never ever put in a trap... Me!~ |
|
|
| Report Abuse |
|
|