Hi - Sorry if I’m using the wrong method; I’m trying to advance my knowledge of Scripting.
So, I’m working on a Wand / Magic system right now that is Chat based, however, the way it works is it checks to see if a Function of the Spell’s name resides within the required Module, so:
local Spell = "Lumos"
local Module = require(Module)
if Module[Spell] ~= nil then
end
What I’m looking to is allow this to work for spells with spaces, as I can’t have a function with a space in suches as:
Magic.Protego Maxima = function()
end
So when noting “Spell” as: “Protego Maxima” How can I convert this into “Protego_Maxima” so that the function can be:
std::string string.gsub(std::string s, std::string pattern, auto repl);
// Returns a copy of s in which all
// (or the first n, if given) occurrences of the
// pattern have been replaced by a replacement
// string specified by repl, which can be a string,
// a table, or a function.
// gsub also returns, as its second value,
// the total number of matches that occurred.