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: I was just wondering...

Previous Thread :: Next Thread 
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
15 Nov 2012 08:49 PM
You know how in batch, you can use the goto 5
:5
and it will skip over a section of script? is there a way to do this in lua?
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
15 Nov 2012 08:50 PM
for n=1,10 do
if(num~=5)then
print(n)
end end
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
15 Nov 2012 08:51 PM
Not really. In lua, you create functions and call them. You basically make a list and pick out certain ones at certain times. So in theory yes, but actually no.
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
15 Nov 2012 08:52 PM
so is n num? and is it a random from 1-10?
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
15 Nov 2012 08:52 PM
goto is usually universally condemned as bad practice. You should not ever have to write code that uses GOTOs.

You should definitely be using a different sort of code structure if you're finding yourself needing them.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
15 Nov 2012 08:54 PM
You need a tutorial on for loops, don't you? :P
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
15 Nov 2012 08:54 PM
e.e
it's part of a coding language
called batch
look it up my friend
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
15 Nov 2012 08:55 PM
@Top, yes, yes I do.
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
15 Nov 2012 08:56 PM
I know what batch is, I've never coded in it though.
I figured you knew what a for loop was to, since you obviously know batch.
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
15 Nov 2012 08:57 PM
I havent ever used a for loop in any of the languages I know. Ever.
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
15 Nov 2012 08:58 PM
the comment on looking it up wasnt @u top
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
15 Nov 2012 09:02 PM
Mmk, so..


for -- defines you're about to use a for loop
Number=1 -- defines what variable you're using to track the loop, and where you're starting. In this case Number is the variable, and 1 is the start

So far we have
for Number=1

Next we need a comma, and what number we are ending at.
I'm going to stop the loop at 4.

for Number=1,4

Now we need another comma, and how we're going in to get to our number 4.

for Number=1,4,.5 -- Counting by .5, so it will start at 1, then go to 1.5, 2, etc

Add do after this, so the code knows we're ending our for loop arguments

for Number=1,4,.5 do
print("I'm number "..Number.."!") -- Just a simple print statement
end -- This will end our for loop
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
17 Nov 2012 09:22 PM
Thank you, i think I get it now.
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