generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Is there a way to get explorer properties via for loop?

Previous Thread :: Next Thread 
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
15 Sep 2015 04:53 PM
For example, something like this:

for i, v in pairs(Instance, maybe Instance:GetChildren()) do
print(i,v) --ClassName, Part
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
15 Sep 2015 04:55 PM
You will want to have a look at EinsteinK's API parser. It is updated frequently (As frequently as Anaminus's site is updated), and it tells you the properties and methods and such for a particular class.
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
15 Sep 2015 04:56 PM
No, but you CAN do it the other way around.

tab = {Size=Vector3.new(1,1,1),BrickColor=BrickColor.new("Really red"),Transparency=1}
part = Instance.new("Part",workspace)

for i,v in pairs(tab) do part[i]=v end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
15 Sep 2015 04:58 PM
Well, you CAN do it without an API parser, but idk if you want to brute-force class members each time or not.
Report Abuse
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
15 Sep 2015 05:02 PM
hm. I was planning on making a useful function. It'd take your selection in studio and convert those properties into code, that, when placed into a script, actually works and produces an exact replica of the original instance. I'm making this because I like to frame out what my GUIs will look like before I actually code it. The function looks a little bit like this right now:

AutoProperties = function()
local BackupVariable = game.Workspace
local AutoVariable = game.Selection:Get()[1] or BackupVariable or nil
if AutoVariable == nil then return nil end
local CurrentCode = "local "..AutoVariable.Name.."=Instance.new(\""..AutoVariable.ClassName.."\","..AutoVariable.Parent:GetFullName()..")"

return(CurrentCode)
end

print(AutoProperties())
Report Abuse
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
15 Sep 2015 05:06 PM
also, @phoenix53124:

Hi, I'm earth. Have we met?
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
15 Sep 2015 05:08 PM
^ lol ikr

yeah a :GetProperties would be pretty cool but otherwise you'll have to save the existing properties and load them (or load someone else's)
Report Abuse
MrSquer is not online. MrSquer
Joined: 18 Feb 2011
Total Posts: 6103
15 Sep 2015 05:25 PM
hm, so do I have to use the XML metadata for now?
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
15 Sep 2015 08:38 PM
Nope, just parse this as json.
http://jacob.easleycompany.com/api/apidump
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
15 Sep 2015 08:47 PM
This might be what you want: pastebin/zjPucx8E
Just loop through the properties table and see if it exists on an instance.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
15 Sep 2015 08:56 PM
Just
use
EinsteinK's
API
Parser
it's
super
simple
and
contains
all
you
will
likely
need
that
is
relevant
to
this
thread.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
15 Sep 2015 08:58 PM
^ it's not like dennis' solution would work anyway
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
15 Sep 2015 08:59 PM
I DID SOMETHING LIKE THIS LET ME GIVE IT TO U
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
15 Sep 2015 09:00 PM
Mine works m8s. Any language where you can parse json (hint: pretty much every language)
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
15 Sep 2015 09:02 PM
function F.WholeLerp(ob,prop,coro,steps,t,target,start)
local function go()
local org=start or ob[prop]
for i=1,steps do
ob[prop]=(org+(target-org)*(i/steps))
wait(t/steps)
end
end
if coro then
spawn(go)
else
go()
end
end
F.WholeLerp(Gui,'Rotation',true,4,.1,0)

Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
15 Sep 2015 09:07 PM
@lordrambo Why wouldn't it work?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
15 Sep 2015 09:07 PM
Because he wants properties of an object, not all properties that exist in general.
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
15 Sep 2015 09:09 PM
Just try to pcall return it and see if it exists on an instance. One downside is if you happen to have an instance with the name of one of those properties.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
15 Sep 2015 09:10 PM
ugh why you make me explain myself

what do you plan to iterate through every single property to see if it belongs to a class using pcall to dodge the errors and then print whatever the value is? terrible and inefficient
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
15 Sep 2015 09:10 PM
With mine:
JsonDecodedTable.Class[ClassName].PropertyMap
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
15 Sep 2015 09:11 PM
Never said it was efficient.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
15 Sep 2015 09:12 PM
but it's so stupid to do it that way when you could just use a precompiled list of instance's and their respective properties

OR
when you can use an api dump that actually updates
Report Abuse
TickerOfTime is not online. TickerOfTime
Joined: 02 Sep 2012
Total Posts: 2030
15 Sep 2015 09:13 PM
"but it's so stupid to do it that way when you could just use a precompiled list of instance's and their respective properties

OR
when you can use an api dump that actually updates"

So use mine
Report Abuse
dennis96411 is not online. dennis96411
Joined: 06 Mar 2009
Total Posts: 1079
15 Sep 2015 09:13 PM
Yes, you definitely could. I was just providing one way of doing it. I didn't say it's the best way of doing it.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
15 Sep 2015 09:14 PM
well I you realize you answered an already answered question with a much worse solution, which is why you got called out on it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image