|
| 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 |
|
|
|
| 21 Nov 2011 06:11 PM |
| Replace "i" with "y". Go to SH next time. |
|
|
| Report Abuse |
|
|
|
| 21 Nov 2011 06:15 PM |
| *Correction* It IS a Y... And what's SH? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 21 Nov 2011 06:24 PM |
AKA: http://www.roblox.com/Forum/ShowForum.aspx?ForumID=20 |
|
|
| Report Abuse |
|
|
| |
|