No response from DialogChoiceSelected

Hello,

I am having a bit of trouble using the DialogChoiceSelected event for Dialog. My issue is that whenever I try to use this nothing ever happens.

Here is my starting code:

local script:

event = script.Parent.RemoteEvent
script.Parent.DialogChoiceSelected:Connect(function(plr, choice)
    event:FireServer(plr, choice)
end)

server script:

event = script.Parent.RemoteEvent
event.OnServerEvent:Connect(function(plr, choice)
    print(plr, choice)
end)

I tried to put prints in with the server and local script for when each function is called and they are never printed out, which leads me to believe they’re not being called. Can anyone point out what I could be doing wrong?

When you fire an event, the server automatically gets which player fired the event, followed by the data you passed. So in this case

event.OnServerEvent:Connect(function(plr, choice)

plr is the automatic player object returned and choice is the player object since you manually passed it in the remote event. You just need to remove the player object passed in the client script

Edit:
I just searched up the api documentation for dialogs and you actually have to specify which property of the dialog you want to send to the server since the event returns an object (objects can’t be passed through remote events). So just use either of these two:

event:FireServer(choice.UserDialog)

or

event:FireServer(choice.ResponseDialog)
2 Likes

After taking your advice it seems like my problem remains. I’m really not sure what the issue could be.

Yeah, I’ve tried DialogChoiceSelected, it apparently just doesn’t fire. Try #platform-feedback:engine-bugs

I think you and @Uralic is doing something wrong. I was able to get the client and server to print the player who used the dialog, user dialog and response dialog without any issues:



Here’s a place file for reference:
Dialog Demo.rbxl (19.6 KB)

Edit:
I updated the demo place to provide a better example and debug information.