Use something like Dialog.DialogChoiceSelected to detect what dialog they picked. Here is a forum post too on an example on how it could be used, and just change what choice your looking for, and make it CanCollide of a part off if the player picked the right choice.
Because local scripts don’t run in the workspace… You need to move them into a container that runs local scripts and adjust the script to make it work once moved
Hey there,
Dialog doesn’t work with server scripts. If you want a part to delete on the server you can do this through remote events.
Make a RemoteEvent in ReplicatedStorage
Create a local script inside StarterGui and inside it put
local dialogpart = game.Workspace:WaitForChild("put your dialogpart here")
local rs = game:GetService("ReplicatedStorage")
local event = rs:WaitForChild("put your remote event here")
dialogpart.Dialog.DialogChoiceSelected:Connect(function(player, choice)
if choice.Name == "No" then
event:FireServer()
end
end)
Then, put a serverscript in the part with your dialog, inside it put
local rs = game:GetService("ReplicatedStorage")
local event = rs:WaitForChild("put your remote event here")
event.OnServerEvent:Connect(function()
game.Workspace.CollideFloor:Destroy()
end)