Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help me with module script error?

In module script i have this

local module = {}

function module:GUI(Arguments)
local	GUI = script.ScreenGui
GUI:Clone().Parent = game.StarterGui
end

return module

in ServerScriptService in a Script have have this

require(344669506)

When I join the game and hit F9 under server log tab it show this error

"DataModel.httpPost" should be ""HttpPost"

2 comments

2

That warning shouldn't be related to this code..

0

This is my first time making module script

2 answers

✓ Accepted answer

Module scripts are a little odd at first, but you were almost there.

Example of module script function:

module = { }

function module.doThis()
	--Code
end

return module

How to call the function in another script:

module = require([Path to Module Script]) -- This will call the module script and return the variables

module.doThis() --This should run your function.

Using your information:

local module = {}

function module.GUI(Arguments) --Replaced ':' with '.'
local  GUI = script.ScreenGui
GUI:Clone().Parent = game.StarterGui
end

return module

From here, you would need to direct a path to the module script when you call it using require.

It should look something like this...

require(game.ServerScriptService.ModuleScript)

Above is not what you need to put to get this working, this is just an example of what you need to do to get it working.

Let me know if you have any other questions.

Note: I think the error you provided is for something else entirely.

Hi there I think this is because you are getting an external module from a ROBLOX server, rather than just getting the one from the game!

Have you got HTTP Service in the Workspace enabled? :)

2 comments

0

He wants answers, not questions... unless you're waiting for him to answer your answer and edit it later...

0

I gave him an answer... the answer is to check that HTTP service is enabled.

This discussion is preserved as it was. New answers, comments, and votes are closed.