client,service=nil,nil return function(z,y)if y then setfenv(1,y)end local C local v local x=false local W=z.Options local c=z.Name local V=client.UI.Make("\087\105\110\100\111\119",{Name=c or"\083\101\108\101\099\116\105\111\110\080\114\111\109\112\116",Title=c or"\083\101\108\101\099\116\105\111\110 \080\114\111\109\112\116",Icon=client.MatIcons["\070\111\114\109\097\116 \108\105\115\116 \098\117\108\108\101\116\101\100"];Size={225;150},SizeLocked=true;OnClose=function()if not v then v=nil end x=true end})local h=V:Add("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{Size=UDim2.new(1,0,1,0);Position=UDim2.new(0,0,0,0);BackgroundTransparency=1})local m=service.New("\085\073\076\105\115\116\076\097\121\111\117\116",{Parent=h,FillDirection="\086\101\114\116\105\099\097\108";HorizontalAlignment="\067\101\110\116\101\114";VerticalAlignment="\084\111\112"})for z,y in W do h:Add("\084\101\120\116\066\117\116\116\111\110",{Text=y.Text,Size=UDim2.new(1,0,0,30),OnClick=function()v=y.Data x=true V:Destroy()end})end h.CanvasSize=UDim2.new(0,0,0,m.AbsoluteContentSize.Y)h.CanvasPosition=Vector2.new(0,m.AbsoluteContentSize.Y)C=V.gTable V:Ready()repeat wait()until x==true return v end
client, service = nil, nil

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

	local done = false;
	local options = data.Options;
	local name = data.Name;

	local window = client.UI.Make("Window",{
		Name  = name or "SelectionPrompt";
		Title = name or "Selection Prompt";
		Icon = client.MatIcons["Format list bulleted"];
		Size  = {225,150};
		SizeLocked = true;
		OnClose = function()
			if not answer then
				answer = nil
			end
			
			done = true;
		end
	})


	local frame = window:Add("ScrollingFrame", {
		Size = UDim2.new(1, 0, 1, 0);
		Position = UDim2.new(0, 0, 0, 0);
		BackgroundTransparency = 1;
	})

	local layout = service.New("UIListLayout", {
		Parent = frame;
		FillDirection = "Vertical";
		HorizontalAlignment = "Center";
		VerticalAlignment = "Top";
	})

	for i,v in options do
		frame:Add("TextButton", {
			Text = v.Text;
			Size = UDim2.new(1, 0, 0, 30);
			OnClick = function()
				answer = v.Data;
				done = true;
				window:Destroy();
			end;
		})
	end

	frame.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y)
	frame.CanvasPosition = Vector2.new(0, layout.AbsoluteContentSize.Y)


	gTable = window.gTable
	window:Ready()
	repeat wait() until done == true;
	return answer
end
