Can someone help me with the default dialogue system?

I know it isn’t the greatest system, but I like the feel of the gui. I have tried a few ways of doing it such as a localscript and serverscript. But it doesn’t seem to work.

localscript:

local dialogue = script.Parent

dialogue.DialogChoiceSelected:Connect(function(plr)
warn(“working”)
end)

I already know the default system is crap but I would like to use it. So if you could give some suggestions that would help greatly.

Take a look at these:
Dialog
DialogChoice

Tried the given localscript an it still isn’t working

Script:

local dialog = script.Parent

local function onChoiceSelected(_player, _choice)

local currentPlayers = dialog:GetCurrentPlayers()

print("The current players in the dialog:")

for _, player in ipairs(currentPlayers) do

	print(player)

end

end

dialog.DialogChoiceSelected:Connect(onChoiceSelected)

Where is the localscript placed?

it is placed within the dialogue that is in the head of a npc in the workspace

Just realised. You are placing the localscript in workspace. Localscripts NEVER run in the workspace.

Wow, thanks I was stuck on that for 2 days

You can access things from a localscript in workspace, but they won’t run in it.

Place it in StarterPlayerScripts and change the reference to dialogue.

Thanks, got it working smoothly

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.