So I have a table of words, these words correspond to a model in-game. The idea is the player can say "regen ..ModelNameFromTable" and that model will regen.
RegenModule = require(game.ServerScriptService.RegenModule)
local Models= {
"ModelTest",
"Model",
}
function onChatted(msg, recipient, Player)
msg = string.lower(msg)
if (msg == "regen"..Models.ModelName) then
RegenModule.Regen(Player)
end
end
As you can see I put an example here "if (msg == "regen"..Models.ModelName) then", but obviously this does not work.
Also, it would have to carry over as an argument to the ModuleScript, as that's where the main script is located.

2 comments
Also The onChatted function has to be called...
This isn't the entire code.