Hello! I’m RazorBladedino117, and I have questions I’m hoping the community can answer. I currently have a build system, similar to fortnite’s, and I was thinking of a new idea to call on functions from a module, as each building piece, has a different way to calculate it’s position in my project.
Local Script
‘’’lua
local CalculateModule = (blah blah)
— Later on in the script —
Blueprint = “Wall”
CalculateModule.FireCalc(Blueprint)
‘’’
Module Script
‘’’lua
local CalculateModule = (blah blah)
CalculateModule.FunctionTable ={[“Wall”] = function CalcWall(Blueprint) print(Blueprint) end}
function CalculateModule.FireCalc(Blueprint)
local Function = CalculateModule.FunctionTable[Blueprint]
Function(Blueprint)
end
return CalculateModule
‘’’
Would this actually print out “Wall” ? Sorry for any typos, as I’m currently on mobile. Thanks for all the help!