How to compile all properties with a specific datatype into a table

i know its something VERY niche but i do infact have a scenario for it where this would be useful and i don’t know how to do it
let’s say i’m trying to find the biggest number that exists in my game (lets just say for a stupid pointless board in the game or something) so

for i, v in game:GetDescendants() do
-- either some way to check through all properties of v, or get all properties that match a datatype
end

anyways enough justifying, is this even possible :worm:

hey there, just for clarification, what do you mean by biggest number? would it be something like scanning through every object’s size, name, attributes, tags, etc. and finding the biggest number? if theres a vector3 like 300, 29, 9583 and 9583 is the biggest number in the game, would that be what you are looking for?

You’ll likely need to use an API dump, there’s plenty of resources on the DevForum you can search for, there’s no built-in method to get the properties of an instance/class that you have access to (until they finally enable ReflectionService).

i was making progress on this and currently the issue im having is that i see litterally zero numbers in coming, so i just see nil for the resulting “number”
code for big table of properties

local ClassProperties = {}
local Properties = {}

local Data = -- apparently im not allowed to show this on devforum, its just a api dump
function hasProperty(object, propertyName)
	local success, _ = pcall(function() 
		object[propertyName] = object[propertyName]
	end)
	return success
end
for _, v in Data.Classes do
	local propertyTable = {Name = v.Name, Properties = {}}
	for _, v2 in pairs(v.Members) do
		if v2.MemberType == "Property" then
			if v2.Security.Read == "RobloxScriptSecurity" or v2.Security.Read == "PluginSecurity" or v2.Security.Read == "RobloxSecurity" or v2.Security.Read == "LocalUserSecurity" then
				continue
			end
			if hasProperty(v2, "Capabilities") then
				if hasProperty(v2.Capabilities, "Read") then
					if table.find(v2.Capabilities.Read, "PluginOrOpenCloud") then
						continue
					end
				end
			end
			table.insert(propertyTable.Properties, v2.Name)
		end
	end
	if #propertyTable.Properties > 0 then
		ClassProperties[v.Name] = propertyTable.Properties
	end
end

function Properties:GetProperties(className)
	if ClassProperties[className] then
	return ClassProperties[className]
	else -- somehow the check fails
		return {}
	end
end

return Properties

specific function

[20] = function(number:number)
		header[tostring(number)].SurfaceGui.TextLabel.Text = "The Largest Number In Game Ten Seconds Ago."
		local numbers = {}
		for _, v in game:GetDescendants() do
			local prop = Properties:GetProperties(v.ClassName)
			if prop ~= {} then
				for i, g in prop do
					local forbidden = {
						"AuthorityMode",
						"AvatarUnificationMode",
						"FluidForces",
						"IKControlConstraintSupport",
						"MeshPartHeadsAndAccessories",
						"Scale",
						"LoadStringEnabled",
						"ExtendLightRangeTo120",
					}
					local function checkIfContains(toCheck)
						for _, e in forbidden do
							if string.match(toCheck, e) then
								return true
							end
						end

						return false
					end
					if checkIfContains(tostring(g)) or v:IsA("Workspace") or v:IsA("Terrain") or v:IsA("SoundService") or v:IsA("Players") or v:IsA("StarterPlayer") or v:IsA("StarterGui") then continue end
					if v:IsA("InsertService") or v:IsA("Motor6D") or v:IsA("HumanoidDescription") or v:IsA("Lighting") then continue end
					local p = v[g]
					print(p)
					task.wait()
					if type(p) ~= "number" or type(p) ~= "string" then continue end
					task.wait()
					table.insert(numbers, tonumber(p))
				end
			end
			daft:RemoveTableDupes(numbers)
			print(numbers)
			table.sort(numbers)
			feet[tostring(number)].SurfaceGui.TextLabel.Text = tostring(numbers[1])
		end
	end,

(the excluded ones were the ones who kept on complaining about not finding anything when searched through)
side note: how do i implment vector3 checks cuz while printing i saw stuff like
" -47.4047737, 12.4996643, -66.6774139, -1, 0, 0, 0, 1, 0, 0, 0, -1"
and
" -180, 0, -180 "
so what’s the deal with that?

This is an impossible type condition, it continues if p is not a number or is not a string, as a singleton can’t be two types at once, nothing gets inserted into numbers.

1 Like

me when i use a or where there should be a and + vice versa