So I have this whole quest thing going on in my game and I created a simple script where when a specific dialog choice is selected the script will check if the selected choice is the dialog choice It needs ( aka the dialog choice that allows the game to progress ) and if it does it prints a string.
However, my script doesn’t have any errors it just skips the function.
I have a feeling that my script works perfectly fine but I have miss-used the DialogChoiceSelected function.
--Variables
local Dialog = script.Parent
local DialogChoice = Dialog.DialogChoice
-- Function is run ( checks if the selected choice was dialog choice )
Dialog.DialogChoiceSelected:Connect(function(SelectedChoice)
if SelectedChoice == DialogChoice then
print("Quest Activated")
end
end)
I found the problem, the DialogChoiceSelected function cannot run in a regular script, instead it has to be in a localscript and must be parented to the StarterPlayerScripts folder For some reason that I am un aware of