IronNoob

Please login or register.

Login with username, password and session length
Advanced search  

News:

Migrated to dedicated hosting. Post any weirdness you observe in the Lounge.

Pages: [1] 2

Author Topic: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors  (Read 829 times)

0 Members and 1 Guest are viewing this topic.

shedletsky

  • Administrator
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1152
    • View Profile

Roblox Tutorial Scripting[5] Moving Part

Post any questions you have here - I'm trying to compose a FAQ for the ROBLOX wiki (I and maybe others will also answer them).
Logged
John Shedletsky on Twitter Counter" width="88" height="26" border="0

Trappingnoobs

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1408
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #1 on: August 03, 2011, 03:32:05 pm »

What's a generic for loop? Is it the ordinary one? I've heard it a lot and was planning to look it up whenever I remembered and wasn't messing around on minecraft or something, and since you want questions.
Logged
monospaced pl0x





no i am not a troll

samacado

  • RBX Spec Ops
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 517
    • View Profile
    • Twitter
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #2 on: August 03, 2011, 03:37:31 pm »

What is this 'recursion' thing so many geeks make jokes about, and how do I get in on the joke?
Logged

Stickmasterluke

  • RBX Spec Ops
  • Full Member
  • *****
  • Offline Offline
  • Posts: 248
  • :D!
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #3 on: August 04, 2011, 02:39:36 am »

What's a generic for loop? Is it the ordinary one? I've heard it a lot and was planning to look it up whenever I remembered and wasn't messing around on minecraft or something, and since you want questions.
In the tutorial I talk about simple "for loops." If you want a real loop you can use

Code: [Select]
while true do
--content
end
or
Code: [Select]
repeat
--content
until true
You can change out the "true" for a condition if you would like the loop to end, or run a line that says "break" inside of the loop. While the condition true is true, they will both continue to loop.

Personally I use while true do, and I can make it solve all of my problems.
Logged

Trappingnoobs

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1408
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #4 on: August 04, 2011, 04:31:44 am »

What's a generic for loop? Is it the ordinary one? I've heard it a lot and was planning to look it up whenever I remembered and wasn't messing around on minecraft or something, and since you want questions.
In the tutorial I talk about simple "for loops." If you want a real loop you can use

Code: [Select]
while true do
--content
end
or
Code: [Select]
repeat
--content
until true
You can change out the "true" for a condition if you would like the loop to end, or run a line that says "break" inside of the loop. While the condition true is true, they will both continue to loop.

Personally I use while true do, and I can make it solve all of my problems.

Nah, I know all the loops, I've just always heard the word generic and never known which loop it corresponded to.
Logged
monospaced pl0x





no i am not a troll

xzbobzx

  • RBX Spec Ops
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 8836
  • ಠ_ಠ
    • View Profile
    • Bobstudios.org
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #5 on: August 14, 2011, 07:38:59 am »

Excuse me good sir, but exactly why do you press the little green square before you work on a script?
This is the very worst way to script, no matter how you look at it... :P
Logged


Trappingnoobs

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1408
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #6 on: August 14, 2011, 02:12:07 pm »

Excuse me good sir, but exactly why do you press the little green square before you work on a script?
This is the very worst way to script, no matter how you look at it... :P

SQUARE?!

Ok, you must now watch this educational video:

Mister Maker - Shapes

You may also find this usefull:

Children's: Shapes
Logged
monospaced pl0x





no i am not a troll

xzbobzx

  • RBX Spec Ops
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 8836
  • ಠ_ಠ
    • View Profile
    • Bobstudios.org
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #7 on: August 15, 2011, 03:03:30 am »

Excuse me good sir, but exactly why do you press the little green square before you work on a script?
This is the very worst way to script, no matter how you look at it... :P

SQUARE?!

Ok, you must now watch this educational video:

Mister Maker - Shapes

You may also find this usefull:

Children's: Shapes

So that green thingy is called a triangle you say?
Well golly, I never actually realized that there are any other shapes than squares!
Logged


blocco

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 86
  • (ROBLOX) Lua Scripting Extraordinaire RbxAPIMaster
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #8 on: August 15, 2011, 12:50:06 pm »

Excuse me good sir, but exactly why do you press the little green square before you work on a script?
This is the very worst way to script, no matter how you look at it... :P

SQUARE?!

Ok, you must now watch this educational video:

Mister Maker - Shapes

You may also find this usefull:

Children's: Shapes

LOL I thought they were gonna make Nyan Cat with the squares.  O_O

What is this 'recursion' thing so many geeks make jokes about, and how do I get in on the joke?

Google 'recursion'.  At least that's what I think it is.  Not sure.
« Last Edit: August 15, 2011, 12:54:29 pm by blocco »
Logged
Well, I'm a scripter.  I know that much.

Trappingnoobs

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1408
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #9 on: August 15, 2011, 03:03:22 pm »

LOL I thought they were gonna make Nyan Cat with the squares.  O_O

Damn, can't find a video to teach you the difference between a cat and a square.
Logged
monospaced pl0x





no i am not a troll

Zuka

  • Guest
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #10 on: August 15, 2011, 03:14:29 pm »

Recursion is like...

Code: [Select]
local maxderp = 10
function someFunc(derp)
if derp < maxderp then
print(derp)
someFunc(derp + 1)
end
end

derp(0)

That basically prints 0-9. Or something like that. It's like looping but you can do more with it.
Logged

Tomtomn00

  • Newbie
  • *
  • Offline Offline
  • Posts: 16
  • We look down on you
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #11 on: August 21, 2011, 08:29:13 am »

Okay.
Logged


wiipro55

  • Newbie
  • *
  • Offline Offline
  • Posts: 7
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #12 on: November 26, 2011, 06:46:45 pm »

Oh I see
Logged

madattak

  • Hero Member
  • *****
  • Online Online
  • Posts: 3317
  • FOR SCIENCE!
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #13 on: December 04, 2011, 06:20:11 am »

Thankyou! Ive been puzzlign over 'for' loops for ages!
Logged

CAUTION: Tap water may contain high levels of dihydrogen monoxide.

SamuelKingx

  • Full Member
  • ***
  • Offline Offline
  • Posts: 106
  • Hello World
    • View Profile
Re: SML ROBLOX Scripting Tutorial 5: For Loops, CFrames, and Vectors
« Reply #14 on: November 14, 2012, 02:46:40 pm »

Why am I here? I can do all this.
Logged
Skype: SamuelKingx
Steam: SamuelKingx
Twitter: @SamuelKingx
ROBLOX: SamuelKingx
PSN: xSamuelKingx
Pages: [1] 2
 

Page created in 0.168 seconds with 22 queries.