What do you want to achieve?
I want to play a sound for the player when he opens a dialog (clicks on the question mark)
What is the issue?
I could not find a way to play the sound when the player clicks on the question mark. I found a way to play the sound, but only if the player chooses a DialogChoice.
What solutions have you tried so far?
I’ve looked up on the internet and devhub for solutions, but couldn’t find one.
local dialog = script.Parent
local sound = script.Parent.sound
dialog:GetPropertyChangedSignal("InUse"):Connect(function()
if dialog.InUse == true then
print("Playing")
sound:Play()
print("Played")
end
end)
It prints both “Playing” and “Played” but the sound still wont play.
I dropped this in a menu for a test … works fine when opened.
LocalScript, in the frame… sound within.
local frame=script.Parent
local sound=script:WaitForChild("Sound")
frame:GetPropertyChangedSignal("Visible"):Connect(function()
if frame.Visible then
sound:Play()
end
end)