Why does this return nil?

I’m sending a value to a module script which is just a simple number value but it just keeps returning nil no matter what. What is going on?

1 Like

Can we see your script, please?

1 Like

I’m not sure what the issue is since you didn’t show your script, but I will try and help you by showing an example of sending an int value to a module script and then having the module script print it out.

Module Script (in Server Script Storage)

local module = {} 

function module.printNum(x)
	
	print(x)
	
end

return module

Script sending the int value to the module script

local serverScriptStorage = game:GetService("ServerScriptService")

local module_ = require(serverScriptStorage.ModuleScript)

module_.printNum(10)


Output

I hope that this helps!

Oops forgot to say that I solved it. It was simple sorry.