|
| 08 May 2012 11:42 AM |
local B1 = game.Workspace:findFirstChild("B1")
while 2 + 2 == 4 do local hhh = game.Workspace:findFirstChild() for i = 1,#hhh,10 do if hhh[1] == "B1" then wait() B1.CFrame = CFrame.new(0,1.4,i) end end end Output: Argument 1 missing or nil - Script "Workspace.Script", Line 4 - stack end im new to scripting |
|
|
| Report Abuse |
|
|
Tj3
|
  |
| Joined: 12 Mar 2008 |
| Total Posts: 677 |
|
|
| 08 May 2012 12:55 PM |
| What exactly are you trying to do? There's a few errors, so it'll be better if you explain what your goal of this script is, and I'll re-write it and explain how it works. |
|
|
| Report Abuse |
|
|
3lex33
|
  |
| Joined: 08 Oct 2008 |
| Total Posts: 5220 |
|
|
| 08 May 2012 01:07 PM |
hhh = game.Workspace:GetChildren(), you probably wanted this.
And, why did you make loop have 10 step? Rather strange, as your B1 part may not get in. As above was said, tell us if what you want to do. |
|
|
| Report Abuse |
|
|
|
| 08 May 2012 02:49 PM |
| I'm trying to make a brick that goes in 1 direction forever |
|
|
| Report Abuse |
|
|
|
| 08 May 2012 02:50 PM |
| Using while then and for do because i'm new to scripting i'm trying to learn |
|
|
| Report Abuse |
|
|
3lex33
|
  |
| Joined: 08 Oct 2008 |
| Total Posts: 5220 |
|
|
| 08 May 2012 04:46 PM |
Instead of assigning brick height as "for" loop variable, it is easier to tilt it in the direction using while or repeat loop.
while true do brick.Position = brick.Position+Vector3.new(0, 0, 1) end
"For" loop shall be used only if you know exactly if how much times loop will be runned. What is more, you can not make infinite loop using "for" loop only, so use while/repeat for this. |
|
|
| Report Abuse |
|
|