-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoDialogue.luau
More file actions
54 lines (39 loc) · 1.36 KB
/
Copy pathAutoDialogue.luau
File metadata and controls
54 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--!strict
local dialogueMakerKit = script.Parent.Parent; -- Replace with your own path to the DialogueMakerKit folder.
local Client = require(dialogueMakerKit.Packages.Client);
local Conversation = require(dialogueMakerKit.Packages.Conversation);
local Message = require(dialogueMakerKit.Packages.Message);
local Redirect = require(dialogueMakerKit.Packages.Redirect);
local StandardTheme = require(dialogueMakerKit.Packages.StandardTheme);
-- Create a new conversation.
local function generateDynamicMessageContent()
local words = {"mama", "mia", "hey", "oh", "my"}
local wordCount = Random.new():NextInteger(4, 10);
local content = "";
for wordIndex = 1, wordCount do
local selectedWord = words[Random.new():NextInteger(1, #words)];
content = `{content}{if content ~= "" then " " else ""}{selectedWord}`;
end
return {content};
end;
local conversation = Conversation.new({}, {
Message.new(generateDynamicMessageContent, {
runCompletionAction = function(self, client)
self:runCleanupAction(client);
end
}, {
Redirect.new({}, function(self)
return {self:getConversation():getNextVerifiedDialogue()};
end);
});
});
-- Start the conversation.
Client.new({
dialogue = conversation:getNextVerifiedDialogue();
settings = {
theme = {
component = StandardTheme
};
};
});
return {};