Dialogue Script not working! Need help!

I’ve been trying to make this script to work. I dont know what I’m doing wrong, I am pretty new to coding. There are no errors in the output.
Screenshot 2025-04-06 221057

heres the code:

local dialog = script.Parent
local rs = game:GetService("ReplicatedStorage")

dialog.DialogChoiceSelected:Connect(function(player, choice)
	if choice == dialog.MedkitChoice then
		rs.MedKit:Clone("MedKit").Parent = player.Backpack
	end
	
end)

the reason nothing happens is twofold

one dialogchoiceselected only fires on the client so a script under ur npc wont ever catch it u need a localscript
two clone takes no arguments calling clonemedkit silently fails

place this as a localscript in starterplayerscripts or under the dialog in startercharacterscripts

That’s because you’re using a localscript, try using a server script.