I have a module script inside ReplicatedStorage, when I try to require and use it as a function inside a script located in ServerScriptService I get an error saying Attempt to call an instance
My ServerScriptService file:
local GetRandomNums = RS.Utils:WaitForChild('GetRandomNums') -- ... local randomNums = GetRandomNums(0, #players:GetPlayers(), 2)
The Module itself:
function GetRandomNums(min, max, numsCount) -- ... end return GetRandomNums
How can I fix this problem?
You need to require the module
local GetRandomNums = require(RS.Utils:WaitForChild('GetRandomNums')) -- ... local randomNums = GetRandomNums(0, #players:GetPlayers(), 2)