Hey! I’m currently learning how to use Types
in Roblox(Luau)
, so I decided to make a module for my game with Types
, but it seems I can’t declare a variable or a function of the module after it was created, here’s the image:
Module Code:
--// VARIABLES
local ModulesFolder:Instance = script.Parent
--// IMPORTS
local TypesModule:{} = require(ModulesFolder:FindFirstChild("Types"))
--// MODULE
local BaseClassModule:TypesModule._BaseClass = {}
--// MODULE FUNCTIONS
function BaseClassModule.new(anchorPoints:{Instance}, controlPoints:{Instance}): TypesModule._BaseObject
end
--// RETURNS
return BaseClassModule
TypesModule Code:
--// MODULE
local TypesModule:{} = {}
--// EXPORTS
export type _MainModule = {
BaseClass:_BaseClass,
Types:{}
}
export type _BaseClass = {
new: ({Instance}, {Instance}) -> _BaseObject
}
export type _BaseObject = {
GetAnchorPoints: () -> {Instance},
GetControlPoints: () -> {Instance},
}
--// RETURNS
return TypesModule
I would be grateful for your help!