I am trying to return a Function within a Function in a module script, but its returning nil.
Here are the script structures
–Module Script–
local module = {}
function module.Function()
--Script Stuff
local function innerFunction()
--More script stuff
end
return innerFunction
end
end
return module
–Calling Script (Server)–
local mod = require(game.ReplicatedStorage.Modules.Module)
local func = mod.Function()
func()
But when called in the actual script it throws error
Script:5: attempt to call a nil value
Then when printed it is nil?
Im stumped on this ![]()