Properties+, read properties of an instance

Properties+

Module: Properties - Roblox
Plugin: Properties+ - Roblox
Open source: Properties+

Properties+ is a module and plugin that reads all available properties of a given instance through a shortcut, code, or more once called through a script, since there is no built-in function to do the same as how the module does.

Functions

All available functions to call:

  • :GetProperties(instance) → Returns a table of properties of a particular instance.
  • :ReadEnumerator(enum) → Use a enum (ex. Material) and reads all EnumItems available to it.
  • :SetName(instance, string_name) → Sets a name for a given instance.
  • :GetName(instance) → Gets a name of a particular instance.
  • :SetValue(instance, value) → Sets a value for a particular property
  • :GetValue(instance) → Gets a value.

Code example:

--> code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Properties = require(ReplicatedStorage:WaitForChild("Properties"))

print(Properties:GetProperties(workspace))
print(Properties:GetProperties(script))

print(Properties:ReadEnumerator(Enum.Material))
Properties:SetName(script, "noob")
print(Properties:GetName(script))

--> output:
--[[
There are 12 properties for Workspace
table: 0x08156aa9bc78a5bb = {
                    ["AllowThirdPartySales"] = false,
                    ["Archivable"] = true,
                    ["ClassName"] = "Workspace",
                    ["CurrentCamera"] = Camera,
                    ["DistributedGameTime"] = 0,
                    ["FallenPartsDestroyHeight"] = -500,
                    ["FilteringEnabled"] = true,
                    ["Gravity"] = 196.1999969482422,
                    ["InterpolationThrottling"] = Default,
                    ["Name"] = "Workspace",
                    ["Parent"] = PluginEnvironment,
                    ["StreamingEnabled"] = false
                 }
Workspace
There are 5 properties for ReadEnumerator
table: 0x48efe39d544eabcb = {
                    ["Archivable"] = true,
                    ["ClassName"] = "Script",
                    ["Disabled"] = false,
                    ["Name"] = "ReadEnumerator",
                    ["Parent"] = Workspace
                 }

table: 0x49a82e8ad7f2e66b = {
                    [1] = Plastic,
                    [2] = Wood,
                    [3] = Slate,
                    [4] = Concrete,
                    [5] = CorrodedMetal,
                    [6] = DiamondPlate,
                    [7] = Foil,
                    [8] = Grass,
                    [9] = Ice,
                    [10] = Marble,
                    [11] = Granite,
                    [12] = Brick,
                    [13] = Pebble,
                    [14] = Sand,
                    [15] = Fabric,
                    [16] = SmoothPlastic,
                    [17] = Metal,
                    [18] = WoodPlanks,
                    [19] = Cobblestone,
                    [20] = Air,
                    [21] = Water,
                    [22] = Rock,
                    [23] = Glacier,
                    [24] = Snow,
                    [25] = Sandstone,
                    [26] = Mud,
                    [27] = Basalt,
                    [28] = Ground,
                    [29] = CrackedLava,
                    [30] = Neon,
                    [31] = Glass,
                    [32] = Asphalt,
                    [33] = LeafyGrass,
                    [34] = Salt,
                    [35] = Limestone,
                    [36] = Pavement,
                    [37] = ForceField
                 }
noob
]]

Usecases AFAIK:

  • Debugging,
  • Development of games,
  • Plugin development.

So far, it has all instances that are public to a newer developer AFAIK, make a pull request or a reply here if I am missing any instances or service.

15 Likes

Sir where have you been all my life?!

Amazing thank you for this~


probably don’t use int here it’s confusing and people might think it’s integer, use instance instead

4 Likes

Right, I have removed int and changed it to instance keyword, and your welcome.

1 Like

very cool
can you make it public?
image

The most beautiful thing I’ve seen in my life. Gods this is useful.

Apparently, this is an older version of the module. Made a new version of the module and made it public: Properties - Roblox

1 Like

I like this, very convienient. But there are a few things I felt I should point out:

Firstly:


This type of structure is really a no-no when your module is this large scale, use a table and read from it based on it’s .ClassName, (services are also their own classes iirc)
e.g:

PropertiesTable[Argument.ClassName] --> { DistributedGameTime, ... }

That should run a teensy bit better while also giving so much needed scalability and cleanliness to your structure that you would not have by just continually adding if’s for each class of instance.

On that note, I don’t know much about it but I do know CloneTrooper1019 has a maintained API dump on his github, you could probably make use of this to add further flexibility so that your users don’t have to fork or pull request everytime a new class is implemented. Let clonetrooper do the work for you. :stuck_out_tongue:

And then there’s the obvious moral question, why do I need this? I personally don’t think you really do, any use case for it would just be really niche and solvable through a more conventional alternative… Could be wrong on that tho.

Overall cool beanz

1 Like

Hmm,

I am not familiar with HTTPService nor do I want to implement into my module, I have dictonaries set up to change with ease and add for long term. You should read this: API Method to easily get the properties of an object - #48 by sparker22

Something you should ask yourself, not me. In game development, if you’re changing values of a particular value like a NumberValue or a Vector3, using this would be ideally helpful to read any property changes. Other developers using this will come up a usecase in present or future time.

I am not familiar with HTTPService nor do I want to implement into my module,

That is perfectly ok, but some may also not want to wait a week or two for you to change and then push an update to this module when a new class releases.

I have dictonaries set up to change with ease and add for long term.

That doesn’t make sense, a dictionary long term requires you to get on and edit the module to add a new list of properties everytime, you won’t be maintaining this module forever, and to be fair neither will clone trooper be maintaining his dump forever. But that’s why the API dump is open source, anyone can get on and change it, and then anything using that as a depency will instantly have the update. If anything, using a dump IS a more long term solution…

Something you should ask yourself, not me.

I’m not talking about myself, I’m speaking in general. As i mentioned earlier, niche things like this are only handy solutions to keep your current idea, that’s it. Conundrums like this are easily replaced by as stated earlier, conventional alternatives.

if you’re changing values of a particular value like a NumberValue or a Vector3, using this would be ideally helpful to read any property changes.

What you mean by this sentence is not very clear to me, if you want to see when a value changes, we have .Changed and PropertyChangedSignals for this reason. And just because you can come up with a use case does not mean it is automatically valid, as I said earlier it’s more of a moral question, picking the least redundant option is best here.

4 Likes

You have no clue of the capabilities this Module has allowed us to create advance things faster and better. For example, Instance serialization, Property comparison, Property copying between different classes and so on.

It’s true that this module doesn’t have to exist for all of that to be possible but for me I really don’t have the will to exert energy for something that is simply stupid, in this case Roblox not implementing :GetProperties after many years of asking. :man_shrugging:

So to me this is a god bless and frankly one of the most useful resource I’ve seen in a while on here.

Although, yeah I guess the OP could be indexing a dictionary instead of a bunch of if statements but idrc as long as it works well, I don’t think the performance gain is worth the effort.


@loueque is the source on GitHub up to date GetProperties does nothing aside from printing

Property comparison is useless in effect if we’re both thinking of the same thing here, but regular property comparison can be done without this module: (foo.Property == baz.Property) And about ‘property copying between different classes’ I genuinly fail to see a case where that’s useful, you can substitute direct class mutation with composition or even inheritance, which you should already be using anyway.

And about Instance serilization, serializing the entirety of an instance is not useful, like I said earlier many use cases you could argue this module supports may likely be redundant because it’s such a niche feature, you should only be serializing what you need to store, storing entire instances does not come cheap especially with how garguantuan the roblox API is already.

in this case Roblox not implementing :GetProperties after many years of asking. :man_shrugging:

I wonder why? Why do you think attributes are only exposed through :Get() and :Set() methods? Directly mutating properties was likely unfeasible, I doubt property access is as rudimentary as you think it is…

Although, yeah I guess the OP could be indexing a dictionary instead of a bunch of if statements but idrc as long as it works well, I don’t think the performance gain is worth the effort.

“All of this just works!” jokes aside, it’s not about performance, that’d be very micro. As I mentioned it’s about scalability and cleanliness here.

1 Like

Why use this over Instance.Name?

Should be up to date as of now, and what else would you want the module to do instead of having properties being printed when calling the function? Curious to know.

I’ve implemented that when starting working on this module, to be fair, it should be removed (Instance.Name seems more reliable than using :GetName()).


I’m probably going to add HTTP into the module later this month, found some open source of all instances + a post somewhere of a function to get all properties of an instance, yet HTTP isn’t a long term solution. :thinking:

1 Like

Return the table of properties instead of flooding the output with prints of course. It’s called GetProperties not PrintProperties so it’d expect it to do what the name suggests.

And I also don’t see why you need to use : instead of . for Methods / Functions when you are not using self

Shipped an update, removed all print statements, and now returns props, even attributes. All : notations are now . notation.

Planning to do something of converting those dictionaries → tables sometime this month, however, got to know a good time period to do some.

found a bug after using this for 5 minutes

Incorrect property name for GuiObjects

Module doesn’t work with ScreenGui

image
image

you should probably write tests to make sure the module works fine


changes that I made to fix those two issues
Properties.lua (113.0 KB)

Thanks, these issues have been fixed. Updated the plugin and module that has those fixed changes, even source code.