How to change response dialogue through script

can u put ur script and merge it with mine cuz i still dont understand

I can’t write whole scripts for you, anyway heres the local script, on the server side, make it so it destroys the apples. change it to your needs:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Backpack = Player.Backpack

local Dialog = workspace.Part.Dialog

local Apple = game.ReplicatedStorage.Apple

local function CheckForApple(dialogchoice)
for I,v in Backpack:GetChildren() do 
	if v:IsA("Tool") and v.Name == Apple.Name then
		game.ReplicatedStorage.DestroyApple:FireServer()
	else
		print(dialogchoice) -- Make the character speak, im to lazy to replicate the whole character
	end
end

--Do the same with the character

for I,v in Character:GetChildren() do 
	if v:IsA("Tool") and v.Name == Apple.Name then
			game.ReplicatedStorage.DestroyApple:FireServer()
	else
			print(dialogchoice) -- Make the character speak, im to lazy to replicate the whole character
	end
	end
end

Dialog.DialogChoiceSelected:Connect(function(plr, dialogchoice)
	if dialogchoice.Name == "Yes" then
		CheckForApple(dialogchoice)
	elseif dialogchoice.Name == "No" then
		print(dialogchoice)
	end
end)

also i wont talk for 1h cuz i wont be available so. ill talk after 1h if u give an answer