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
 

Re: Returning a table?

Previous Thread :: Next Thread 
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
11 Aug 2015 10:32 AM
Localscript:

_G.GlobalFunction(arg1, arg2)
-- Where does arg3, 4, 5, and 6 come from?
end





GlobalFunction Script:

_G["GlobalFunction"] = function(arg1, arg2)
--blahblahblah
return{arg3, arg4, arg5, arg6}
end
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
11 Aug 2015 10:39 AM
local table = {arg3,arg4,arg5,arg6}
return table


VB.NET, C#, C++, PHP and much more
Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
11 Aug 2015 10:50 AM
Hmm... How would the LocalScript access those values?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
11 Aug 2015 10:53 AM
Modules and RemoteEvents.
Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
11 Aug 2015 11:07 AM
well then, got to learn how to use those two..
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Aug 2015 11:17 AM
"Modules and RemoteEvents."
You'll want RemoteFunctions for this.
Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
11 Aug 2015 11:59 AM
OK. So I gave ModuleScripts a look. BUT.....?



===================================================
ModuleScript:
===================================================
local module = {}

module.returnOtherArgs= function(arg1, arg2)
--blahblah
return arg3, arg4, arg5
end

return module


===================================================
LocalScript:
===================================================
local getmod = require(game.ServerScriptService.Module)

print(getmod.returnOtherArgs(arg1, arg2))



===================================================
Output:
===================================================
nil 4 nil 5



How do I use 4, and 5 in the local script? ASDFHUG

Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
11 Aug 2015 12:01 PM
oops ignore that second nil
Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
11 Aug 2015 12:13 PM
I'm guessing module scripts only return arguments that are passed to the function?
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