Dialog function not triggering{CLOSED}

I am trying to make a dialog system and the function is not running to delete the part.
I would love help on this!
Setup:
image

Code:

local Dialog = script.Parent.Dialog
local floor = game.Workspace.Cave.Floor
local function onSelected(player, choice)
	if choice == Dialog.PlayerSaidNo then
		floor:Destroy()
	end
end
Dialog.DialogChoiceSelected:Connect(onSelected)

Umm change it either to be normal script or move it so that it’s in either a StarterGui ScreenGui, StarterPlayerScripts or StarterCharacterScripts. As I believe that is the only place they can run