I need help passing this string to a ModuleScript as an argument because the current method I'm using is just converting it to a table value or something.
I have a ModuleScript with a function called close which has one argument called containment. Here is the part of that function I'm having issues with:
local module = {}
function module.close(containment)
local door = script.Parent[containment .. " [1] [SHUTTER]"]
-- The rest of the code has been omitted because it is functional when containment's value is "SCP-330".
end
return module
I am calling it from a Script using this code:
local module = require(workspace.Shutters.ModuleScript)
module:close(script.Parent.Parent.Parent["Field Codes"].ItemNumber.SurfaceGui.TextLabel.Text) -- This text is always "SCP-330".
When the function is called like this, the ModuleScript returns the following error:
03:12:12.473 - Workspace.Shutters.ModuleScript:40: attempt to concatenate local 'containment' (a table value)
I should also note that I get this error no matter what, even if I try to use module:close("SCP-330").
I added a line of code to close that prints the value of containment. It returned the following:
table: 0000026DA172D2F0
I didn't use a table, and I have no idea where the random matrix of numbers came from.
It should also be noted that if I use Studio's Command Bar to call the function, it works as intended.

6 comments
hi i love scps, anyways. if the command bar works that must mean this or another script is sending the wrong value to the module script. it would maybe help if you'd show the command bar code you are sending.
Also, run a for loop on the table and print its children, that will help you get an idea of what is happening. Example: for i,v in next, table do print(i,v) end
Have you got a Discord? That'd make this easier.
are you in the scriptinghelpers discord? You can find me there as Vile Dreams
I might be wrong, but if you call the function with : the first argument is self.
I didn't even notice I was calling it like that. Now I'm calling it with . and it works... lol. Thanks I guess.