|
| 22 Jun 2012 11:12 AM |
x = script.Parent.Position.X y = script.Parent.Position.Y z = script.Parent.Position.Z
while true do for i = 1,50 do script.Parent.CFrame = CFrame.new(x,y + 0.01,z) wait(0.01) end for i = 50,1 do script.Parent.CFrame = CFrame.new(x,y - 0.01,z) wait(0.01) end end
There's no output. The brick moves up 0.01, once, and does not repeat. I'd like it to repeat, I can't figure out why it isn't working though.
~Death to lazy builders. Remove the CFrame tools. Command bar all the way. -pauljkl Derpity derp derp. My favorite saying. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 11:18 AM |
for i = 50,1 do
the 50 and 1 are the wrong way round here, thats all I can see wrong at the moment. |
|
|
| Report Abuse |
|
|
gamehero
|
  |
| Joined: 12 Jun 2007 |
| Total Posts: 1455 |
|
|
| 22 Jun 2012 11:19 AM |
I think I fixed all the errors.. Sorry for not testing it first.
x = script.Parent.Position.X y = script.Parent.Position.Y z = script.Parent.Position.Z
while true do for i = 1,50,0.01 do script.Parent.CFrame = CFrame.new(x,y + i,z) wait(0.01) end for i = 50,1,-0.01 do script.Parent.CFrame = CFrame.new(x,y + i,z) wait(0.01) end end |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 11:20 AM |
Tried that, inverts behavior. I probably derped so hard, I'm kinda new to for loops :P
~Death to lazy builders. Remove the CFrame tools. Command bar all the way. -pauljkl Derpity derp derp. My favorite saying. |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 22 Jun 2012 11:21 AM |
Those are read only values, you need to add a vector3 script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0, -.01, 0) also you can't wait that short of a time, the minimum wait time is wait() which is about .03 seconds also if you want to count down in a numeric for loop, you need to specify that, because the default counting interval is 1 for i = 50,1,-1 do a last thing: put a wait() somewhere in you while true do loop, but outside of the for loops. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 11:22 AM |
Above post was a reply to Hilarious. @game; Seems to never go on to the second for loop? Other then that, it works.
~Death to lazy builders. Remove the CFrame tools. Command bar all the way. -pauljkl Derpity derp derp. My favorite saying. |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 22 Jun 2012 11:23 AM |
| if you do what I say, it'll work |
|
|
| Report Abuse |
|
|
gamehero
|
  |
| Joined: 12 Jun 2007 |
| Total Posts: 1455 |
|
|
| 22 Jun 2012 11:24 AM |
| Oops... Change the 50s in the for loops to 2 or something. |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 22 Jun 2012 11:27 AM |
while true do wait() for i = 1,50 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0, .01, 0) wait() end for i = 50,1,-1 do script.Parent.CFrame = script.Parent.CFrame + Vector3.new(0, -.01, 0) wait() end end |
|
|
| Report Abuse |
|
|
killjoy37
|
  |
| Joined: 27 Aug 2008 |
| Total Posts: 2821 |
|
|
| 22 Jun 2012 11:28 AM |
| I hope you realize it is only going to move half a stud in about 1.5 seconds |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2012 11:30 AM |
@kill; Thanks! Wasn't aiming for a specific...Whatever you call it, can't speak today lol. I can always change how far it moves, just wanted to get it working first.
~Death to lazy builders. Remove the CFrame tools. Command bar all the way. -pauljkl Derpity derp derp. My favorite saying. |
|
|
| Report Abuse |
|
|