Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help With Modules?

Asked by 7 years ago

Hello there, I don't seem to understand the concept of Modules, so I was wondering if anyone could help me or send me a link to a place that can help me, I couldn't understand it in the Roblox website sadly.

2 answers

Log in to vote
1
Answered by
theCJarmy7 1293 Moderation Voter
7 years ago

They return stuff.

--I'm horrid at explaining stuff
--in a moduleScript--
function thing(otherThing)
    --put stuff here
end
return thing
--in a script--
thing = require(theModuleScriptObject) --will return the function thing
thing(10)
--this also helps with sending over many functons
local tab = {}

function tab.f1()
    --stuff
end

function tab.f2()
    --stuff
end

function tab.f3()
    --stuff
end
return tab
--in a script--
module = require(theModuleScriptObject)
f1 = module.f1
f2 = module.f2
f3 = module.f3

That's pretty much it. Leave a comment if this didn't answer your question.

0
Wow, thanks alot! chill22518 145 — 7y
Ad
Log in to vote
0
Answered by
Etheroit 178
7 years ago

Here is link to roblox's Tutorial http://wiki.roblox.com/index.php?title=API:Class/ModuleScript

0
I said Roblox's tutorial didnt help, but thanks anyways <3 chill22518 145 — 7y
0
Oh okay ;) Sorry I didnt read Etheroit 178 — 7y

Answer this question