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: uhhh my fail self needs help with variables lol

Previous Thread :: Next Thread 
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
07 Oct 2012 05:36 PM
how would I make something like this work:

for i=1,10 do
a=number..i
end

["number"..i] does not work either.
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
07 Oct 2012 05:37 PM
for i = 1,10 do
a = (i)
print(a)
wait(1)
end
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
07 Oct 2012 05:39 PM
for i=1, 10 do
print("Number "..i)
wait(1)
end
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
07 Oct 2012 05:40 PM
You need to put parentheses between variables if it's a number. Else, it wouldn't work. I don't know why though.
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
07 Oct 2012 07:22 PM
I want to put "number"before the number i so if i was 5 it would look like this:

print(a)
>number5
Report Abuse
PuzzleCrazy is not online. PuzzleCrazy
Joined: 01 Feb 2010
Total Posts: 1245
07 Oct 2012 07:33 PM
for i=1, 10 do
print("number"..i)
end
Report Abuse
mazer246 is not online. mazer246
Joined: 13 Sep 2007
Total Posts: 412
07 Oct 2012 08:38 PM
a = ("number"..a)
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
07 Oct 2012 08:40 PM
^That wouldn't print it.
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
07 Oct 2012 08:41 PM
for i = 1,10 do
a = (i)
print("number"..a)
wait(1)
end
Report Abuse
shred1894 is not online. shred1894
Joined: 30 Aug 2009
Total Posts: 6515
07 Oct 2012 08:47 PM
Actually


for i = 1,10 do
wait(1)
print("Number = ", i)
end

S-1894>(Supreme_Commander_of_Advanced_Zero)
Report Abuse
AnimalCrossingDev is not online. AnimalCrossingDev
Joined: 17 Aug 2012
Total Posts: 264
07 Oct 2012 10:16 PM
I dont care about the printing but I need a=number..i, I cannot figure out how to do this, I know how to make it print "number"..i but I need to set a variable to number..i
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Oct 2012 10:21 PM
    for i = 1, 10 do
     a = "number " .. i
    end

¤ ¤ † K M X D † ¤ ¤
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
08 Oct 2012 03:36 PM
^Would end up only giving you "number 10" because you're replacing the 'a' variable.

Variables = {};
for i=1, 10 do
Variables[i] = "Number "..i;
end

print(table.concat(Variables,", "));
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
08 Oct 2012 03:44 PM
'You need to put parentheses between variables if it's a number. Else, it wouldn't work. I don't know why though.'

wat
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
08 Oct 2012 03:48 PM
@blackboy;

No you don't?...
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