Help detecting when a certain dialogue has been selected

Hi!

I have been working on a cashier system for my corner store game, and I want the NPC to have a dialogue so the player can check them out; however, my script does not detect if the player has clicked the dialogue.

Server side script:

local val = game.ReplicatedStorage.m
local event = game.ReplicatedStorage.Event

event.OnServerEvent:Connect(function()
	val.Value += math.random(5,25)
end)

LocalScript:

script.Parent.DialogChoiceSelected:Connect(function()
	game.ReplicatedStorage.Event:FireServer()
end)

Setup:

image

Dialog:

image

DialogChoice:

image

(I want the script to be triggered when the player agrees to check the customer out.)

Thanks in advance!