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: How to make module to talk with script

Previous Thread :: Next Thread 
AnimeWiki is not online. AnimeWiki
Joined: 26 Oct 2014
Total Posts: 460
03 Mar 2015 10:19 AM
like if i have variables and tables inside module how can i share with main script ?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
03 Mar 2015 10:21 AM
require()

⬡
Report Abuse
AnimeWiki is not online. AnimeWiki
Joined: 26 Oct 2014
Total Posts: 460
03 Mar 2015 10:23 AM
thank you but thats not what i mean if u are variable inside module how can u talk with main script.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
03 Mar 2015 10:24 AM
http://wiki.roblox.com/index.php?title=Module_scripts
Report Abuse
gskw is not online. gskw
Joined: 05 Jan 2013
Total Posts: 1364
03 Mar 2015 10:25 AM
On the last line of the Module, return a table, like so:
return {my_variable = my_variable};

So now, when you require() the Module:
local module = require(workspace.ModuleScript);

You can use your function in the script:
print(module.my_variable);

This is a signature. Recommended username: HeavenlyGskw
Report Abuse
AnimeWiki is not online. AnimeWiki
Joined: 26 Oct 2014
Total Posts: 460
03 Mar 2015 10:28 AM
thank you my jedi.
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