Calling a function within a function in a module script does not carry parameters

I have a module script that is supposed to take parameters when it’s called (working) and send those same parameters to another local function within the module script (not working)
Here is an example:

local function not_working(player)
     print(player) -- nil
end)

function module.func(player)
     not_working(player)
end)

Any help is appreciated.

Assuming you are talking about sending data, you use return

Example:

function A()
  return 10 -- returns 10
end

function B()
  local func = A() -- calls function A
  print(func) -- prints 10 which was returned by function A
end

B()

To Assign a Parameter:

function A()
	return 10 -- returns 10
end

function B(Hi)
	Hi = A() --  Assigns our Parameter as the function, dont forget to add "()" otherwise it will not work
	print(Hi) -- prints 10 which was returned by function A
end

B()

You can use a variable to send data with out using return.

true, but its probably better to use return when sending data

What is the nature of the module, where is it require()'d from?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.