How to make a ui apear when a dialog ends

how would i make it so that a ui apears when a dialog ends

game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.whateverui.Visible = true

plus, you could have searched up answers before posting this

Unfortunately, it’s not possible to specifically bind it to when a dialog ends since there isn’t a disengagement event AFAIK. But there is a DialogChoiceSelected event you can bind it to.

local LastDialogOption = nil --Change to the last option available.
DialogInstance.DialogChoiceSelected:connect(function(Plr, DialogChoice)
	if DialogChoice == LastDialogOption then
		Plr.PlayerGui.SpecialGui.Enabled = true --Something similar to this. You could also clone and parent it to their PlayerGui instead.
	end
end)

Another option is to an infinite loop checking Dialog:GetCurrentPlayers() until the player leaves the table but that would be extremely taxing on the server and isn’t a great solution.