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