return function(y,k)if k then setfenv(1,k)end if not y.Question then return end local S=y.gTable local x=script.Parent.Parent.BaseClip local T=y.Duration or y.Timeout local M local X=x.Frame local G=X G.Parent=x G.Position=UDim2.new(.5,-210,0,-G.Size.Y.Offset)G.Visible=true local h=G:WaitForChild("\066\111\100\121")local F=h:WaitForChild("\079\112\116\105\111\110\115")local Q,v=F:WaitForChild("\067\111\110\102\105\114\109"),F:WaitForChild("\067\097\110\099\101\108")local m=h:WaitForChild("\067\111\109\109\097\110\100")local p=X.Top.Title m.Text=y.Subtitle or" "h.Ques.Text=y.Question or"\085\110\107\110\111\119\110"p.Text=y.Title or"\089\101\115\047\078\111 \080\114\111\109\112\116"h.Options.Cancel.Text=y.No or"\078\111"h.Options.Confirm.Text=y.Yes or"\089\101\115"S:Ready()S.CustomDestroy=function()S.CustomDestroy=nil S.ClearEvents()if M==nil then M=y.No or"\078\111"end pcall(function()G:TweenPosition(UDim2.new(.5,-210,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(y)if y==Enum.TweenStatus.Completed then G:Destroy()end end)wait(.3)end)S:Destroy()end G:TweenPosition(UDim2.new(.5,-210,.5,-70),"\079\117\116","\081\117\105\110\116",.3,true)local t t=S.BindEvent(Q.MouseButton1Click,function()t:Disconnect()G:TweenPosition(UDim2.new(.5,-210,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(y)if y==Enum.TweenStatus.Completed then G:Destroy()end end)M=y.Yes or"\089\101\115"wait(.3)S:Destroy()end)local E E=S.BindEvent(v.MouseButton1Click,function()E:Disconnect()G:TweenPosition(UDim2.new(.5,-210,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(y)if y==Enum.TweenStatus.Completed then G:Destroy()end end)M=y.No or"\078\111"wait(.3)S:Destroy()end)local j=tick()repeat wait()until M~=nil or T and tick()-T>T if M==nil then M=false end return M end
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name
--// Be sure to update the console gui's code if you change stuff

return function(data, env)
	if env then
		setfenv(1, env)
	end

	if not data.Question then
		return
	end

	local gTable = data.gTable
	local baseClip = script.Parent.Parent.BaseClip
	local duration = data.Duration or data.Timeout

	local toReturn
	local confirmationTemplate = baseClip.Frame
	local confirmationClone = confirmationTemplate
	confirmationClone.Parent = baseClip
	confirmationClone.Position = UDim2.new(0.5, -210, 0, -confirmationClone.Size.Y.Offset)
	confirmationClone.Visible = true
	local Body = confirmationClone:WaitForChild("Body")
	local Options = Body:WaitForChild("Options")
	local Confirm, Cancel = Options:WaitForChild("Confirm"), Options:WaitForChild("Cancel")
	local commandText = Body:WaitForChild("Command")
	local title = confirmationTemplate.Top.Title

	commandText.Text = data.Subtitle or " "
	Body.Ques.Text = data.Question or "Unknown"
	title.Text = data.Title or "Yes/No Prompt"

	Body.Options.Cancel.Text = data.No or "No"
	Body.Options.Confirm.Text = data.Yes or "Yes"

	gTable:Ready()

	gTable.CustomDestroy = function()
		gTable.CustomDestroy = nil
		gTable.ClearEvents()
		if toReturn == nil then
			toReturn = data.No or "No"
		end

		pcall(function()
			confirmationClone:TweenPosition(UDim2.new(0.5, -210, 1, 0), "Out", "Quint", 0.3, true, function(Stat)
				if Stat == Enum.TweenStatus.Completed then
					confirmationClone:Destroy()
				end
			end)

			wait(0.3)
		end)

		gTable:Destroy()
	end

	confirmationClone:TweenPosition(UDim2.new(0.5, -210, 0.5, -70), "Out", "Quint", 0.3, true)
	local Confirming
	Confirming = gTable.BindEvent(Confirm.MouseButton1Click, function()
		Confirming:Disconnect()
		confirmationClone:TweenPosition(UDim2.new(0.5, -210, 1, 0), "Out", "Quint", 0.3, true, function(Stat)
			if Stat == Enum.TweenStatus.Completed then
				confirmationClone:Destroy()
			end
		end)

		toReturn = data.Yes or "Yes"
		wait(0.3)
		gTable:Destroy()
	end)

	local Cancelling
	Cancelling = gTable.BindEvent(Cancel.MouseButton1Click, function()
		Cancelling:Disconnect()
		confirmationClone:TweenPosition(UDim2.new(0.5, -210, 1, 0), "Out", "Quint", 0.3, true, function(Stat)
			if Stat == Enum.TweenStatus.Completed then
				confirmationClone:Destroy()
			end
		end)
		toReturn = data.No or "No"
		wait(0.3)
		gTable:Destroy()
	end)

	local start = tick()
	repeat
		wait()
	until toReturn ~= nil or (duration and (tick() - duration) > duration)
	if toReturn == nil then
		toReturn = false
	end

	return toReturn
end
