local menu = script.Parent
local Load_Gui = {};
local Load_Gui = function (gui)
menu.Text = gui
for i, v in pairs(menu[gui]) do
i.Visible = false
end
end
return Load_Gui;
Localscript
local module = require (script.Parent.menufunction);
script.Parent.InputBegan:Connect(function()
module.Load_Gui("ImageLabel");
end)
I need to fire the function on the modulescript but I get the error mentioned earlier. I kept looking back and forth between an example but i have given up looking by myself.
Did you print the first line of the module, which is after Load_Gui = {}, to see if it worked?
I suspect that the reason why it isn’t working is because you placed a variable outside of the table and return in the module script. Place the variable between the table and the return like you did with the function.