local function l(l)local u=l.tags for l,u in pairs(u)do if u=="\100\101\112\114\101\099\097\116\101\100"or u=="\104\105\100\100\101\110"or u=="\119\114\105\116\101\111\110\108\121"then return true end end return false end function Set(l,u,k)local T=u.Name local N=u.ValueType if k==nil then return end for l,N in pairs(GetSelection())do if CanEditProperty(N,u)then pcall(function()N[T]=k end)end end end function CreateRow(l,u,k)local T=u.Name local N=u.ValueType local q=l[T]local S=Row.BackgroundColor if k then S=Row.BackgroundColorAlternate end local e=not CanEditProperty(l,u)if N=="\073\110\115\116\097\110\099\101"or T=="\080\097\114\101\110\116"then e=true end local h=Instance.new("\070\114\097\109\101")h.Size=UDim2.new(1,0,0,Row.Height)h.BackgroundTransparency=1 h.Name="\082\111\119"local w=CreateCell()w.Parent=h w.ClipsDescendants=true local V=CreateLabel(e)V.Text=T V.Size=UDim2.new(1,-1*Row.TitleMarginLeft,1,0)V.Position=UDim2.new(0,Row.TitleMarginLeft,0,0)V.Parent=w local E=CreateCell()E.Size=UDim2.new(.5,-1,1,0)E.Position=UDim2.new(.5,0,0,0)E.Parent=h local H=GetControl(l,u,e)H.Parent=E h.MouseEnter:connect(function()w.BackgroundColor3=Row.BackgroundColorMouseover E.BackgroundColor3=Row.BackgroundColorMouseover end)h.MouseLeave:connect(function()w.BackgroundColor3=S E.BackgroundColor3=S end)w.BackgroundColor3=S E.BackgroundColor3=S return h end function ClearPropertiesList()for l,u in pairs(ContentFrame:GetChildren())do u:Destroy()end end local u=Gui:FindFirstChild("\083\101\108\101\099\116\105\111\110",1)print(u)function displayProperties(l)for l,u in pairs(l)do pcall(function()local l=CreateRow(u.object,u.propertyData,numRows%2==0)l.Position=UDim2.new(0,0,0,numRows*Row.Height)l.Parent=ContentFrame numRows=numRows+1 end)end end function checkForDupe(l,u)for u,k in pairs(u)do if k.propertyData.Name==l.Name and k.propertyData.ValueType==l.ValueType then return true end end return false end function sortProps(l)table.sort(l,function(l,u)return l.propertyData.Name<u.propertyData.Name end)end function showProperties(u)ClearPropertiesList()if u==nil then return end local k={}local T={}numRows=0 for u,N in pairs(u)do if not T[N.className]then T[N.className]=true for u,T in pairs(RbxApi.GetProperties(N.className))do local q,S=pcall(function()if not l(T)and not checkForDupe(T,k)then if string.find(string.lower(T.Name),string.lower(propertiesSearch.Text))or not searchingProperties()then table.insert(k,{propertyData=T,object=N})end end end)end end end sortProps(k)displayProperties(k)ContentFrame.Size=UDim2.new(1,0,0,numRows*Row.Height)scrollBar.ScrollIndex=0 scrollBar.TotalSpace=numRows*Row.Height scrollBar.Update()end

local function PropertyIsHidden(propertyData)
	local tags = propertyData["tags"]
	for _,name in pairs(tags) do
		if name == "deprecated"
			or name == "hidden"
			or name == "writeonly" then
			return true
		end
	end
	return false
end

function Set(object, propertyData, value)
	local propertyName = propertyData["Name"]
	local propertyType = propertyData["ValueType"]
	
	if value == nil then return end
	
	for i,v in pairs(GetSelection()) do
		if CanEditProperty(v,propertyData) then
			pcall(function()
				--print("Setting " .. propertyName .. " to " .. tostring(value))
				v[propertyName] = value
			end)
		end
	end
end

function CreateRow(object, propertyData, isAlternateRow)
	local propertyName = propertyData["Name"]
	local propertyType = propertyData["ValueType"]
	local propertyValue = object[propertyName]
	--rowValue, rowValueType, isAlternate
	local backColor = Row.BackgroundColor;
	if (isAlternateRow) then
		backColor = Row.BackgroundColorAlternate
	end
	
	local readOnly = not CanEditProperty(object, propertyData)
	if propertyType == "Instance" or propertyName == "Parent" then readOnly = true end

	local rowFrame = Instance.new("Frame")
	rowFrame.Size = UDim2.new(1,0,0,Row.Height)
	rowFrame.BackgroundTransparency = 1
	rowFrame.Name = 'Row'

	local propertyLabelFrame = CreateCell()
	propertyLabelFrame.Parent = rowFrame
	propertyLabelFrame.ClipsDescendants = true
	
	local propertyLabel = CreateLabel(readOnly)
	propertyLabel.Text = propertyName
	propertyLabel.Size = UDim2.new(1, -1 * Row.TitleMarginLeft, 1, 0)
	propertyLabel.Position = UDim2.new(0, Row.TitleMarginLeft, 0, 0)
	propertyLabel.Parent = propertyLabelFrame

	local propertyValueFrame = CreateCell()
	propertyValueFrame.Size = UDim2.new(0.5, -1, 1, 0)
	propertyValueFrame.Position = UDim2.new(0.5, 0, 0, 0)
	propertyValueFrame.Parent = rowFrame

	local control = GetControl(object, propertyData, readOnly)
	control.Parent = propertyValueFrame

	rowFrame.MouseEnter:connect(function()
		propertyLabelFrame.BackgroundColor3 = Row.BackgroundColorMouseover
		propertyValueFrame.BackgroundColor3 = Row.BackgroundColorMouseover
	end)
	rowFrame.MouseLeave:connect(function()
		propertyLabelFrame.BackgroundColor3 = backColor
		propertyValueFrame.BackgroundColor3 = backColor
	end)
	
	propertyLabelFrame.BackgroundColor3 = backColor
	propertyValueFrame.BackgroundColor3 = backColor
	
	return rowFrame
end

function ClearPropertiesList()
	for _,instance in pairs(ContentFrame:GetChildren()) do
		instance:Destroy()
	end
end

local selection = Gui:FindFirstChild("Selection", 1)
print(selection)

function displayProperties(props)
	for i,v in pairs(props) do
		pcall(function()
			local a = CreateRow(v.object, v.propertyData, ((numRows % 2) == 0))
			a.Position = UDim2.new(0,0,0,numRows*Row.Height)
			a.Parent = ContentFrame
			numRows = numRows + 1
		end)
	end
end

function checkForDupe(prop,props)
	for i,v in pairs(props) do
		if v.propertyData.Name == prop.Name and v.propertyData.ValueType == prop.ValueType then
			return true
		end
	end
	return false
end

function sortProps(t)
	table.sort(t, 
		function(x,y) return x.propertyData.Name < y.propertyData.Name
	end)
end

function showProperties(obj)
	ClearPropertiesList()
	if obj == nil then return end
	local propHolder = {}
	local foundProps = {}
	numRows = 0
	for _,nextObj in pairs(obj) do
		if not foundProps[nextObj.className] then
			foundProps[nextObj.className] = true
			for i,v in pairs(RbxApi.GetProperties(nextObj.className)) do
				local suc, err = pcall(function()
					if not (PropertyIsHidden(v)) and not checkForDupe(v,propHolder) then
						if string.find(string.lower(v.Name),string.lower(propertiesSearch.Text)) or not searchingProperties() then
							table.insert(propHolder,{propertyData = v, object = nextObj})
						end
					end
				end)
				--[[if not suc then 
					warn("Problem getting the value of property " .. v.Name .. " | " .. err)
				end	--]]
			end
		end
	end
	sortProps(propHolder)
	displayProperties(propHolder)
	ContentFrame.Size = UDim2.new(1, 0, 0, numRows * Row.Height)
	scrollBar.ScrollIndex = 0
	scrollBar.TotalSpace = numRows * Row.Height
	scrollBar.Update()
end
