Autocomplete/Type checking for unavailable module scripts?

Hello,

I’m currently attempting to make autocomplete work with a module script that is not accessible in edit mode. Below is a snippet and the explorer view of the relevant scripts.

---------------------[[ Animate.lua ]]--------------------
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local RootPart = Character.PrimaryPart or getObject(Character, "HumanoidRootPart")

local HUM_API = require(Humanoid:WaitForChild("API"))
local Temp = script:FindFirstChild("Temp") or script:WaitForChild("Temp")

-- More irrelevant code...

As you can see, the module script isn’t accessible in edit mode from the specified path, and because of that the autocomplete system can’t figure out what HUM_API is, leading to a lack of autocomplete for the HUM_API module while working in the Animate script.

So, is there a way I can somehow tell the system what the HUM_API variable is?

Something like:

local HUM_API: (StarterPlayer.StarterHumanoid.API) = require(Humanoid:WaitForChild("API"))
1 Like

You may be able to define a custom type within the Animate script that outlines all the functions. Note that it will need to be updated whenever you change the module script though. If you are willing, I can quickly write up the type if you send over the module script (or at least the various functions and stuff in it that need to be autocompleted.)

2 Likes