generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: 'for' statements?

Previous Thread :: Next Thread 
joshboy7797 is not online. joshboy7797
Joined: 06 Sep 2008
Total Posts: 1794
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 is not online. 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 is not online. 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 is not online. 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
joshboy7797 is not online. joshboy7797
Joined: 06 Sep 2008
Total Posts: 1794
18 Jul 2011 08:40 PM
ohhh, I kind-of get it now! Thanks :D
Report Abuse
joshboy7797 is not online. joshboy7797
Joined: 06 Sep 2008
Total Posts: 1794
18 Jul 2011 08:42 PM
But what is the line that includes the cframe?
Report Abuse
ZGS is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image