hello everyone, I am having trouble requiring a Module script within a model. I am getting the error "
Attempted to call require with invalid argument(s)", I am unsure of why. This is my script:
local Stages = game.ReplicatedStorage.Stages:GetChildren()
local Stage = Stages[math.random(1, #Stages)]:Clone()
if Stage:FindFirstChild("Start") then
local Start = Stage.Start
local Req = require(Start)
Req.Start()
end
there very clearly is a “Start” script within the model, as you can see here:
I would like to know why it is telling me Start is invalid. Thank you in advance!
I think the problem was that I was attempting to index the module script as just “Start”. When I index it as Stage:FindFirstChildOfClass("ModuleScript") instead of Stage:FindFirstChild("Stage") it works fine. Thank you for helping, I am giving you the solution as I would not have been able to find this without you helping me!