Problem with script initiate when play choice a dialogueChoice

  1. What do you want to achieve? Keep it simple and clear!
    So i wanna achieve script initialize when i choice right dialogueChoice
  2. What is the issue? Include screenshots / videos if possible!
    Idk why it is don’t work
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Nothing helped.

My code:

local Dialog = script.Parent
Dialog.DialogChoiceSelected:connect(function(Player, Choice)
if not Player then return end
	if Choice.Name == "TradeD"then
		local Clicks = Player.leaderstats.Clicks
		local Money = Player.leaderstats.Money
		Money.Value += (Clicks.Value/10)
		Clicks.Value = 0
end
end)

Still can’t figure a problem for some reason

Dialog.DialogChoiceSelected can only run on the client. So you will need to use a local script as well as remote events to change the leaderstats