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: Script not working

Previous Thread :: Next Thread 
111rules111 is not online. 111rules111
Joined: 19 Jul 2010
Total Posts: 1223
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 is not online. 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 is not online. 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
111rules111 is not online. 111rules111
Joined: 19 Jul 2010
Total Posts: 1223
08 May 2012 02:49 PM
I'm trying to make a brick that goes in 1 direction forever
Report Abuse
111rules111 is not online. 111rules111
Joined: 19 Jul 2010
Total Posts: 1223
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 is not online. 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
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