Im making plugin that gets selected object propertie's and pastes them into script, so that you don't have to specify every single property manually in script, it already writes all the objects properties for you and you only change what you want later manually in script.
Problem how could i loop through objects properties and get all it's properties names as string values and just print them out?
I looked through forums and found :GetProperties(), but it doesn't seem to work.
I recently needed a function to get a table of properties of Objects, so I wrote this function. Here you go :D
01 | local ClassProperties do |
02 | -- ClassProperties is a Dictionary of sorted arrays of Properties of Classes |
03 | -- Pulls from anaminus.github.io |
04 | -- Ignores deprecated and RobloxPluginSecurity Properties |
05 | -- Make sure HttpService is Enabled (Roblox Studio -> Home Tab -> Game Settings -> Security -> Allow HTTP requests = "On") |
06 |
07 | ClassProperties = { } |
08 | local HttpService = game:GetService( "HttpService" ) |
09 |
10 | local Data = HttpService:JSONDecode(HttpService:GetAsync( "https://anaminus.github.io/rbx/json/api/latest.json" )) |
11 |
12 | for i = 1 , #Data do |
13 | local Table = Data [ i ] |
14 | local Type = Table. type |
15 |
There is a model for this. Just follow the instructions in the description.
https://www.roblox.com/library/59938771/GetProperties-function
:GetProperties doesn't work...
There's a way, though, to actually get them; Tho it takes lots of time ;I
This is a working, print example (in a regular script):
01 | game.Players.PlayerAdded:connect( function (player) |
02 | --Get Part's properties... |
03 | local Part = game.Workspace.Part |
04 | local BrickColor = Part.BrickColor |
05 | local Color = Part.Color |
06 | local Material = Part.Material |
07 | local Reflectance = Part.Reflectance |
08 | local Transparency = Part.Transparency |
09 | local ClassName = Part.ClassName |
10 | local Name = Part.Name |
11 | local Orientation = Part.Orientation |
12 | local Parent = Part.Parent |
13 | local Position = Part.Position |
14 | local RotVelocity = Part.RotVelocity |
15 | local Velocity = Part.Velocity |
Yes, there's at least by now no automated solution...
If this takes out your doubts, then mark as the solution please.
As always, good scripting.