Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make NPC say something automatic using dialog? [closed]

Asked by 4 years ago
Edited 4 years ago

I want an NPC talking something randomly per a custom time using dialog but not need player to answer OR click the questiion mark (Just like some NPC in The Normal Elevator)

Closed as Not Constructive by hiimgoodpack

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago

you can create a table, and cycle through the list;

local npcSpeech = {
    "I like cheese",
    "I like pie",
    "I am jumping",
    "Doge is alive"
}

local dialog = script.Parent -- or wherever it is

for x = 1, #npcSpeech do
    dialog.InitialPrompt = npcSpeech[x] -- Or however you change the dialog
    wait(math.random(5,20)) -- wait for 5 - 20 seconds before talking again
end

Note i am typing all of this from memory tell me if something is off

0
OK but I want it just show up , not request player to click the question mark ! shime1122 6 — 4y
0
Do you even have any knowledge on dialog or scripting? Just use some other dialog instance or change something other than the initial prompt; search it up on google MmadProgrammer 35 — 4y
Ad