return function(q)if not q.Question then return end local n=q.gTable local g=script.Parent.Parent.BaseClip local M=q.Duration or q.Timeout local N local d=g.Frame local x=d x.Parent=g x.Position=UDim2.new(.5,-210,0,-x.Size.Y.Offset)x.Visible=true local v=x:WaitForChild("\066\111\100\121")local P=v:WaitForChild("\079\112\116\105\111\110\115")local K,a=P:WaitForChild("\067\111\110\102\105\114\109"),P:WaitForChild("\067\097\110\099\101\108")local V=v:WaitForChild("\067\111\109\109\097\110\100")local C=d.Top.Title V.Text=q.Subtitle or" "v.Ques.Text=q.Question or"\085\110\107\110\111\119\110"C.Text=q.Title or"\089\101\115\047\078\111 \080\114\111\109\112\116"v.Options.Cancel.Text=q.No or"\078\111"v.Options.Confirm.Text=q.Yes or"\089\101\115"n:Ready()n.CustomDestroy=function()n.CustomDestroy=nil n.ClearEvents()if N==nil then N=q.No or"\078\111"end pcall(function()x:TweenPosition(UDim2.new(.5,-210,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(q)if q==Enum.TweenStatus.Completed then x:Destroy()end end)wait(.3)end)n:Destroy()end x:TweenPosition(UDim2.new(.5,-210,.5,-70),"\079\117\116","\081\117\105\110\116",.3,true)local r r=n.BindEvent(K.MouseButton1Click,function()r:Disconnect()x:TweenPosition(UDim2.new(.5,-210,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(q)if q==Enum.TweenStatus.Completed then x:Destroy()end end)N=q.Yes or"\089\101\115"wait(.3)n:Destroy()end)local B B=n.BindEvent(a.MouseButton1Click,function()B:Disconnect()x:TweenPosition(UDim2.new(.5,-210,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(q)if q==Enum.TweenStatus.Completed then x:Destroy()end end)N=q.No or"\078\111"wait(.3)n:Destroy()end)local t=tick()repeat wait()until N~=nil or M and tick()-M>M if N==nil then N=false end return N end


return function(data)
	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
