Need help with Dialog

im making a NPC with a dialog option, and when you choose that option, it fires a remote event. but its not working, sorry if the script is really bad, i have never used the Dialog stuff before, heres my localScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvents = ReplicatedStorage:WaitForChild("remoteEvents")
local newCollected = remoteEvents:WaitForChild("newCollected")


local dialogChoiceCorrect4 = script.Parent



dialogChoiceCorrect4.DialogChoiceSelected:Connect(function(player, choice)
	    print("Worked!")
		remoteEvents:WaitForChild("RemoveEvent1"):FireServer(player)
end)

localscripts cant run in workspace so you could put this in starterplayerscripts or make it entirely server based which might be better for you

2 Likes

As @Inkthirsty mentioned, local scripts do not work inside workspace, they must be inside local player’s descendants.

Additionally, I wouldn’t recommend using DialogChoice as it’s pretty much deprecated (tho not entitled as it) and does not provide lots of customization. I would recommend you to do your very own dialog system, there are plethora of tutorials on youtube and here.
LocalScript | Documentation - Roblox Creator Hub

2 Likes