Results 1 to 10 of 10
  1. #1
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default [Sequel][TUT] How to script part 4

    Today, we will learn about for statements. Note: this will be long.
    1. For with variables. for with variable can be used for just about anything! heres a finished example code:
    Code:
    for( i = 0; i <= 12; i++ )
    Now, I will explain all of the code to better understand it.
    1a. Are variable 'i' will be set to the value of 0 and is ended with a semi-colon.
    2a. Are variable 'i' is being questioned if it is less than or equal to 12 and finally is ended by a semi-colon
    3a. Are variable 'i' will be counted up until reaching 13 repeating the script the variable is used for for 13 times.
    2. How to edit a for statement the variable letter or name can be edited to you liking like this:
    Code:
    for( variable = 0; variable <= 12; variable++ )
    2a. The equal to or less than. You can replace these with the following: ( <=, >=, ==, != ) Note: the '!' represents "not" as well the number after the equal and what not.
    3a. Adding Subtracting. You can add or subtract ( variablename++, variablename-- )
    4. Loops with the for statement. You can make a script repeat at a location infinite times with:
    Code:
    for(;;)
    Notice, that the two semi-colons inside are used because of the two ending's on the for statement with variables.
    Hope you liked it.

    0 Not allowed! Not allowed!

  2. #2
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    Terrible waste of a thread

    0 Not allowed! Not allowed!

  3. #3
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    Good work! I just think you should use examples, I know this stuff,
    but for others. When you say
    for( ;; ) they get confused, you should say something like:

    credit()
    {
    for( ;; )
    {
    self iprintlnbold("Loop made by ^3CheeseToast :P");
    wait 30;
    }
    }

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  4. #4
    Blink 182 Give Me Boners mynameisjosh's Avatar
    Join Date
    Oct 2011
    Location
    Massoftwoshits
    Posts
    1,377
    Points
    3,110
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Location
    Massoftwoshits
    Posts
    1,377
    Points
    3,110
    Gamer IDs

    Gamertag: JennaTollzZ PSN ID: HuuughGRection

    Default

    Wouldn't it be an if statement though? like if i is less than 13 ++?

    0 Not allowed! Not allowed!
    Quote Originally Posted by Insane.Dragon View Post
    I fucked a shark once.
    Quote Originally Posted by RED 58 View Post
    i like the sig but i hate russ...
    im seeing conflict here

  5. #5
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    no. and actually some people want to learn all of this so why do you hate.

    0 Not allowed! Not allowed!

  6. #6
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    mynameisjosh, It's a for thingy but not a loop, every time it goes through it adds 1 or subtracts 1 or whatever,
    then the middle part is like an if, so if variable is less then or equal to 12, it adds one.
    The first part is just saying what the variable equals.

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  7. #7
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by CheeseToast View Post
    mynameisjosh, It's a for thingy but not a loop, every time it goes through it adds 1 or subtracts 1 or whatever,
    then the middle part is like an if, so if variable is less then or equal to 12, it adds one.
    The first part is just saying what the variable equals.
    Exactly the point I was trying to make!

    0 Not allowed! Not allowed!

  8. #8
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    I know, but I was just re explaining because your main post didn't make sense to him.

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  9. #9
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default

    Quote Originally Posted by CheeseToast View Post
    I know, but I was just re explaining because your main post didn't make sense to him.
    It's alright man.. I'm gonna apply for coder one last time..

    0 Not allowed! Not allowed!

  10. #10
    Blink 182 Give Me Boners mynameisjosh's Avatar
    Join Date
    Oct 2011
    Location
    Massoftwoshits
    Posts
    1,377
    Points
    3,110
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Location
    Massoftwoshits
    Posts
    1,377
    Points
    3,110
    Gamer IDs

    Gamertag: JennaTollzZ PSN ID: HuuughGRection

    Default

    Thanks cheese. and Newtohacking

    0 Not allowed! Not allowed!
    Quote Originally Posted by Insane.Dragon View Post
    I fucked a shark once.
    Quote Originally Posted by RED 58 View Post
    i like the sig but i hate russ...
    im seeing conflict here

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 12:02 PM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.