Dialogue Choice not printing after used

Hello, may I please be helped I am strugling with something. (This is my first forum)

I want to make a gui to become visible after talked to a NPC

Right now I want it to print something and it is not printing

I have moved the local script to starter player scripts

local Dialog = workspace.Scientist.Head.Dialog


function selected(plr, choice)
	if choice == Dialog.DialogChoice then
		print("Worked")
	end
end

Dialog.DialogChoiceSelected:Connect(selected)
1 Like
local Dialog = workspace.Scientist.Head.Dialog


function selected(plr, choice)
	if choice == "DialogChoice" then
		print("Worked")
	end
end

Dialog.DialogChoiceSelected:Connect(selected)
2 Likes

Still nothing in the output tab.

2 Likes

try to implement a print above the if statement to check it is even triggering the DIalogChoiceSelected

1 Like

I tried that now and still nothing. I think the script might be in wrong place?

If the print is not printing, it means the DialogChoiceSelected Event is not being triggered.

1 Like

where’s the script? (30 blalbla)

image

That’s because it is a local script, change it to a server script inside serverscriptservice. If you still want to make it a local script, try to use a remote event.

Local scripts don’t have direct access to workspace, thus needing a remote event to communicate within the server

1 Like

Still nothing maybe it could be because Roblox dialogues are old?

where did you put the server script?

I put it in server script service

is the script like that?

local Dialog = workspace.Scientist.Head.Dialog

Dialog.DialogChoiceSelected:Connect(function(plr, choice)
	if choice == Dialog.DialogChoice then
		print("worked")
	end
end)

For me it worked. Also, remember you can’t start a dialog with an empty InitialPrompt.

My script is now like that and still nothing

Could it be todo with game settings?

it doesn’t print a thing? What does it say when you click on the dialog


image

I don’t think it has something to do with the game settings