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()

2 comments

0

Are you sure is the function named right and are you sure is that where the error located?

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.