My question is..
I have a StringValue, and the value is set to whatever a player chooses. The player can choose between a multiple of choices, and each of the outcomes are stored inside a ModuleScript, (through function())
I've taken the value of the StringValue, I just don't know where to go next.. I need to take the value of the StringValue, and have the game search through each of the values in the ModuleScript to find a match, and then execute the function that the Variable in the ModuleScript holds.
Im currently using:
local collectedSpell = currentSpell.Value spellModule(string.match(spellModule, currentSpell))
Output: bad argument #1 to 'match' (string expected, got table)
(Most variables aren't showed, but I required the module, and other variables above that)
string.match
takes in 2 required arguments.
The first one is the string you want to locate a match for. The second is a string representing the pattern you want to find.
spellModule
appears to be the module you are using, which is a table value.
currentSpell
appears to be a ValueObject you are using, which wouldn't fit the 2nd argument either.
You'll need to change your first argument to the string you want to look for a match in. As for the 2nd, I think you meant to do collectedSpell
.