so in this module script the CreateDialogue function constructs a dialogue but when i use methods with dialogue no autocompletion happen i tried the new beta type solver and the old one but none worked considering that self is defined as dialoged when setting it as a metatable
--!strict
local CollectionService = game:GetService("CollectionService")
-- ////
export type dialogue = {
HeadText :string,
BodyText :string,
TypeWriter :{mode : typeWriterMode, speed :number, clickSkip : number},
Replies : {[string] : () -> ()},
}
type typeWriterMode = "None" | "Basic" | "CursorBlink" | "Human"
-- ////
local DialogueService = {} -- dialogue class that will create dialogues
local dialogue = {} -- dialogue object
dialogue.__index = dialogue
--////
-- a table to store gui elements
local elements = {
ScreenGui = CollectionService:GetTagged("Dialogue_ScreenGui"),
HeadText = CollectionService:GetTagged("Dialogue_HeadText"), -- Head
BodyText = CollectionService:GetTagged("Dialogue_BodyText"), -- Body
RepliesFrame = CollectionService:GetTagged("Dialogue_RepliesFrame"), -- a scrolling frame that hold replies
ReplySample = CollectionService:GetTagged("ReplySample") -- a reply sample will be cloned to create replies
}
-- Enums Table
DialogueService.Enum = {
TypeWriterMode = {
None = "None",
Basic = "Basic",
CursorBlink = "CursorBlink",
Human = "Human",
}
}
function DialogueService.CreateDialogue(headText :string, bodyText,typeWriter : {mode : typeWriterMode, speed :number, clickSkip : number}, replies : {[string] : () -> ()})
local self :dialogue = {
HeadText = headText,
BodyText = bodyText,
TypeWriter = typeWriter,
Replies = replies,
}
return setmetatable(self, dialogue)
end
function dialogue:Play()
self. -- NO Auto Complete Here
end
return DialogueService
while
the only way i found to get autocompletion is
local self :dialogue = self
but that doesn’t sound like the correct way to do it + local self is a copy of self and not self, so I don’t like doing that
any help is appreciated