Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make NPC say something automatic using dialog?

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)

1 answer

✓ Accepted answer

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

2 comments

0

OK but I want it just show up , not request player to click the question mark !

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

This discussion is preserved as it was. New answers, comments, and votes are closed.