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

Help me with module script error?

Asked by 9 years ago

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
That warning shouldn't be related to this code.. BlueTaslem 18071 — 9y
0
This is my first time making module script RobloxNorton 20 — 9y

2 answers

Log in to vote
0
Answered by
Necrorave 560 Moderation Voter
9 years ago

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.

Ad
Log in to vote
0
Answered by 9 years ago

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? :)

0
He wants answers, not questions... unless you're waiting for him to answer your answer and edit it later... lightpower26 399 — 9y
0
I gave him an answer... the answer is to check that HTTP service is enabled. jjwood1600 215 — 9y

Answer this question