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 » Scripters
Home Search
 

Concatenation of ROBLOX functions

Previous Thread :: Next Thread 
Extemporize is not online. Extemporize
Joined: 08 Jun 2015
Total Posts: 43
09 Jun 2015 03:48 PM
I need to create separate variables for each GUI made, when the GUI making process is a for loop like so:

for i=1, 10 do
--bla bla bla
end

It wouldn't let me do something like:
i .. "derp" = "ayayayay"

Any help would be appreciated, thanks in advance.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
09 Jun 2015 03:51 PM
use tables
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Jun 2015 03:51 PM
What?

Thing[i..'derp'].Banana = i
Report Abuse
Extemporize is not online. Extemporize
Joined: 08 Jun 2015
Total Posts: 43
09 Jun 2015 03:56 PM
So "Thing" would be the variable? Can you re-structure that so I can use it for my own purposes, please?

Here's what I want it to do:

derp .. i = 16
Report Abuse
jode6543 is not online. jode6543
Joined: 16 Jun 2009
Total Posts: 5363
09 Jun 2015 03:58 PM
Wait, what is it you want?
"derp .. i = 16"
You can't do that. That's invalid syntax; Lua has no idea what that means and neither do I.
Report Abuse
Extemporize is not online. Extemporize
Joined: 08 Jun 2015
Total Posts: 43
09 Jun 2015 04:02 PM
Add the amount of times i has looped to "derp" to form a new variable such as 2derp and set it to "ayayayay".
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Jun 2015 04:03 PM
derpies = {};
for i=1,10 do
derpies[i..'derp'] = 16;
end

print(derpies['3derp']) --> 16
Report Abuse
Extemporize is not online. Extemporize
Joined: 08 Jun 2015
Total Posts: 43
09 Jun 2015 04:14 PM
I'm confused though, what is "derpies"?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Jun 2015 04:15 PM
A table. Learn to use them.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jun 2015 04:21 PM
for i=1, 10 do
getfenv(0)["derp"..i] = "yayme"
end

print(derp1, derp2, derp3, derp4, derp5, derp6, derp7, derp8, derp9, derp10)
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
09 Jun 2015 04:22 PM
I didn't give that solution because it's not practical and he needs to learn tables anyway.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jun 2015 04:30 PM
I did however give that solution because it is what he asked for. You gave him reality, I gave him his dream.


XD
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
09 Jun 2015 04:31 PM
OP WANTS TO CONCATENATE ROBLOX FUNCTIONS!
looks at thread WTF UR TITLE IS MISLEADING
looks at replies WTF IS THAT WHAT HE WANTED
looks at pos reply WTF IM GONNA ACT LIKE A MORON NOW
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jun 2015 04:40 PM
^

Yes.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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