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

Issues when running function of a ModuleScript, possibly and issue when requiring?

Asked by
stef0206 125
3 years ago

I have a main "Server" script, in this script I require a module and call a function within it. When I do this I get the error: "attempt to call a nil value". The function inside the module just prints "hi".

local ServerScriptService = game:GetService('ServerScriptService')
local ModuleScript = require(ServerScriptService.ModuleScript)

ModuleScript:TestFunction()
0
Are you sure is the function named right and are you sure is that where the error located? Block_manvn 395 — 3y
0
Without a doubt, the issue lies when requiring the module, I get ServerScriptService without fail, I get no errors when requiring the module, but then when I try to call a command from the module, I get the mentioned error. stef0206 125 — 3y

Answer this question