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 » Scripters
Home Search
 

For Statment

Previous Thread :: Next Thread 
zerocalory is not online. zerocalory
Joined: 19 Mar 2011
Total Posts: 478
21 Nov 2011 06:09 PM
I'm working on a script to make a brick "jump" up and down, i've made the first part which goes like this.

Part=game.Workspace.Part

for i=1,10 do
Part.CFrame=CFrame.new(0,i,1)
wait(0.01)
end

That's the part that works, but i tried making the other part:

for y=10,1 do
Part.CFrame=CFrame.new(0,i,1)
wait(0.01)
end

And it doesn't work, how could i fix it?
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
21 Nov 2011 06:11 PM
Replace "i" with "y". Go to SH next time.
Report Abuse
zerocalory is not online. zerocalory
Joined: 19 Mar 2011
Total Posts: 478
21 Nov 2011 06:15 PM
*Correction* It IS a Y... And what's SH?
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
21 Nov 2011 06:16 PM
"for y=10,1 do
Part.CFrame=CFrame.new(0,i,1)
wait(0.01)
end"

"Part.CFrame=CFrame.new(0,i,1)"

"(0,i,1)

"i"

Should be a "y"


SH = Scripting Helpers
Report Abuse
Varp is not online. Varp
Joined: 18 Nov 2009
Total Posts: 5333
21 Nov 2011 06:19 PM
for i=10,1,-1 do
Part.CFrame=CFrame.new(0,i,1)
wait(0.01)
end

Two corrections:
One, I did the changing of "y" to "i". It doesn't really matter what name you use though.
Two, and more importantly: I added a 3rd term to your for statement. The -1 I added makes it so that i counts down in increments of -1 (that is, as, 10, 9, 8, ... 3, 2, 1)
Report Abuse
sk8ercool456 is not online. sk8ercool456
Joined: 24 Jan 2008
Total Posts: 1846
21 Nov 2011 06:24 PM
AKA:
http://www.roblox.com/Forum/ShowForum.aspx?ForumID=20
Report Abuse
zerocalory is not online. zerocalory
Joined: 19 Mar 2011
Total Posts: 478
21 Nov 2011 06:25 PM
What, that's genius! :D!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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