|
| 18 Jul 2011 08:36 PM |
I am trying to make a cframe sliding door (a new concept to me), and I was told to use 'for'. I get how it works, I just don't know how to use it.
function door()
for i = ?, ? do script.Parent.Cframe = script.Parent.Cframe*Cframe.new(?,?,?) --I don't know what goes here end end
script.Parent.Touched:connect(door) |
|
|
| Report Abuse |
|
|
alexmach1
|
  |
| Joined: 02 May 2008 |
| Total Posts: 1977 |
|
|
| 18 Jul 2011 08:38 PM |
for i = starting number(0,1), last number, counting by do
example
for i=0, 20, 5 do
goes for 4 steps.
for i=1,20 do
goes for 20 steps. |
|
|
| Report Abuse |
|
|
ZGS
|
  |
| Joined: 01 Aug 2009 |
| Total Posts: 3972 |
|
|
| 18 Jul 2011 08:39 PM |
Lets say you want a script to loop 10 times. You'd use:
for i=1,10 do |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 18 Jul 2011 08:40 PM |
for VARIABLE = START, STOP, STEP do
Variable is the variable you want to use to count as what number it's on Start is where the loop starts. Stop is where the loop stops. Step is the increment it increases by. |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 08:40 PM |
| ohhh, I kind-of get it now! Thanks :D |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2011 08:42 PM |
| But what is the line that includes the cframe? |
|
|
| Report Abuse |
|
|
ZGS
|
  |
| Joined: 01 Aug 2009 |
| Total Posts: 3972 |
|
|
| 18 Jul 2011 08:44 PM |
| http://wiki.roblox.com/index.php/How_to_Make_Ramps |
|
|
| Report Abuse |
|
|