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
 

Searching Table With String

Previous Thread :: Next Thread 
louiskk is not online. louiskk
Joined: 31 Dec 2008
Total Posts: 228
01 Jul 2015 01:32 PM
Well, I'm trying to make a system where I can search a module script for a function and I have the name of the function in string format. Is there any way for me to return the function with the string, or maybe convert it into another form perhaps.
Report Abuse
Twitdoof is not online. Twitdoof
Joined: 17 Aug 2013
Total Posts: 199
01 Jul 2015 01:35 PM
what did you say? lol
Report Abuse
louiskk is not online. louiskk
Joined: 31 Dec 2008
Total Posts: 228
01 Jul 2015 01:36 PM
If you don't know what I'm talking about, why are you here?
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
01 Jul 2015 01:39 PM
local iter = require(264586303);
local module = require(script.ModuleScript);

local func;

for x,y in iter(module) do
if type(y) == 'function' and x == 'NameOfFunction' then
func = y;
end
end

--------------------

This stores the function within a variable called 'func', retrieved from the module defined in the second line.
Report Abuse
louiskk is not online. louiskk
Joined: 31 Dec 2008
Total Posts: 228
01 Jul 2015 01:43 PM
What's iter? As in what does the first require mean?
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
01 Jul 2015 01:45 PM
It's an extended iterator.
It makes things easier.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
01 Jul 2015 01:58 PM
Kot you are over complicating this. Lua already has iterator functions. Why are you trying to add something unnecessary?

for i,v in next, thing do

end


"Talk is cheap. Show me the code." - Linus Tivalds
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
01 Jul 2015 02:22 PM
Time, I know about that, I simply enjoy adding additional features to the already provided API items. I'm not being like IcyFires (you might not know who he is, he was here a long time ago), I'm simply building onto it. The function is very small, it simply returns the built-in iterator (next) but with additional checks.
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