Very odd error "Attempted to call require with invalid argument(s)"

local currentAttack = 1

local movesFolder = game.ReplicatedStorage.clientLibraries.Movesets:FindFirstChild(Type)
local Order = require(movesFolder.Info).Order
local Attack = require(Order[currentAttack]) -- This is the error

That means Order[currentAttack] is not a ModuleScript or an ID to require.

image

image

What do you mean? So my post will be deleted?

The script turns itself nil, that’s probably why

Edit: I asked for more info, but you provided right after I sent it, so I deleted my post

1 Like

I don’t know why this is happening then, there isn’t much info. The only thing I can assume is you are looking in the wrong place or something. Also that script = nil doesn’t do anything

It worked, thank you very very much!

1 Like

indeed, script nil doesn’t do anything
if “Order” is “movesFolder.Info” then why you doing movesFolder.Info.Order
maybe it’s returning nil, the module script

1 Like