Clicking one of the dialog response will play an ID soundtrack #2

I know I have created a topic of it, but since no one is responding to it I made a new one. After someone helped me with my problem, I went a little bit further. I see an error called “Dialog is not a valid member of model.” I was clicking at the error to bring me there we the script was not running, but it didn’t let me. Could anyone help me?

Code:
local sound = workspace.Sound
local sound2 = workspace.Sound2
workspace.Model.Dialog.DialogChoiceSelected:connect(function(player, choice)
print(choice.Name)
if choice.Name == ‘DialogChoice1’ then
sound:Play(4850625559)
elseif choice.Name == ‘DialogChoice2’ then
sound2:Play(4850625559)
end
end)

Can you show me the script?? Thanks

You should include the code, we cannot really tell.

Also don’t duplicated topics. You have to wait if your problems are more elaborate. Not everyone here are having same problems. So be patient. :stuck_out_tongue_winking_eye:

I will remember that, thank you.

1 Like

I edited the topic, the code is now here.

Okay, also make sure to format the code, how can be seen here:

https://devforum.roblox.com/t/developer-forum-formatting-guide/456083

Also, you are not supposed to enter any argument in Sound:Play() !

if choice.Name == ‘DialogChoice1’ then
sound:Play()
elseif choice.Name == ‘DialogChoice2’ then
sound2:Play()
end

Argument, do you mean the ID for the sound? Because I deleted the ID at Sound:Play()

I recommend you to read the :Play() Developer Hub Article.

Understood the article, the script still isn’t running, even tho I put the ID in the 2 sounds.

Ik it’s been 2 years, have you figured it out yet?

It has not been figured out yet, but I really don’t need it anymore thanks for asking though.