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: string manipulation with Properties?

Previous Thread :: Next Thread 
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 05:49 PM
I'd like to know, is there any way of checking an Object for a Property with something in it?
like some Property that contains 'Value', 'Force', 'Color' etc etc...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 06:07 PM
No supported way, you're gonna either have to do pcall or have a table of all the classes and their properties
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 06:10 PM
damnit...
thnx cnt
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
02 May 2015 06:21 PM
cnt you have to be kidding me? You could just try indexing it with string manipulation. I call that supported (Even if it uses pcall)
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 06:25 PM
hmmm
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 06:29 PM
war, make a Module that checks for a Property using :match() XD
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 08:51 PM
Oh I read what OP said incorrectly. I thought he wanted to check if a property exists ;[
Report Abuse
millymanks is not online. millymanks
Joined: 26 Jun 2014
Total Posts: 413
02 May 2015 08:53 PM
OP
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 08:57 PM
lol...
cnt, I needa find a Property that has 'something' in it (Secret for now) and if it has it, then I'll needa finda the most efficent way to check that Property for it's Value...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 08:59 PM
if part.propertyhere:match("thatsomething") then

Hopefully I understand correctly, but if you have, say a StringValue and you want to check if its value contains something then ^
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 09:13 PM
example:

local test = object.findSomeSortOf(lets say Torque, maxTorque, just Torque, etc etc)
table.insert(stuff, test)--this line doesn't matter
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 09:15 PM
Do you know what "someSortOf" is, if so you can just do something like:
local something = "Name"
local test = stringvalue[something]

test would be the stringvalue's Name
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 09:18 PM
k, lets say this

if test[PropertyContains'Id'] then...
get me?

if 'Id' is included in the name of a property... cos am checking every Descendant of Game for stuff...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 09:21 PM
So why wouldn't match work (what I did above)?
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 09:26 PM
cos... I think ur inspecting a StringValue.Value (A String)...
am inspecting ANY Object, if it has a Property with 'Id' in it's Name then do stuff...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 09:27 PM
Yeah just change it to .Name instead of .Value
So:

if object.Name:match("Id") then
print("Has Id in its name");
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
02 May 2015 09:27 PM
Would EinsteinK's API parser work here? Because I honestly still have no idea what you are doing, even after reading every reply.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 09:29 PM
I never used his, I made one a while ago and it's a free model anyways (it's pretty bad but I could care less since it gets the job done and is not meant to be run 100 times a second).
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 09:31 PM
cnt, can't be done...
wat if object.This doesn't exist?
and anyway, am looking for
AnimationId, TextureId, etc...
so I can't do
object.AnimationId:match() :P
as I said, am checking if there is such a property with 'Id' in it (one of those that I said, AnimationId, TextureId, etc)
if anyPropertyOfObjectHas'Id'InItsName then
--stuff
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 09:31 PM
Yeah so you need a table of all the properties then.
Lemme gen. one 1 sec.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
02 May 2015 09:32 PM
EinsteinK's gets the latest API data from Anaminus's github and parses it into a bunch of cool stuff such as a list of classes and Instances (And their superclasses and subclasses), a table containing every property, a table containing every method, and tons of other cool stuff.

For example, if you had the ClassName of an Instance, you could find out it's subclasses (For example, Seat is a subclass of Part), and you could find out all the properties existing for that specific ClassName.

I'll bet it works with Vector3s and stuff too, but I've only ever used it for Instances.
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 09:32 PM
do u know ALL the Properties that contain 'Id' in their name at least?
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
02 May 2015 09:33 PM
jarod, sounds cool
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
02 May 2015 09:34 PM
Yeah that wouldn't be hard to make but I don't need something like that :)

OP: pastebin/iaGM1qPV
Uhm, all of them that contain ID? You can use a loop and remove all of them that don't from that big table ^
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
02 May 2015 09:35 PM
Oh, then here.
local Classes = require(185389806).Classes
---------
for Index, Value in pairs(Classes[ClassName].Properties) do
if Index:match("Id") then
-- Do stuff with Value, the property, and Index, the property index (Or "name", as you called it)
end
end
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