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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: FindFirstChild function for properties?

Previous Thread :: Next Thread 
SADSPenguin is not online. SADSPenguin
Joined: 23 Jul 2014
Total Posts: 21
25 Mar 2015 03:19 PM
would this work:

game.Workspace.Part:FindFirstChild("Name")

would that bring me to the name property of the part, or does it not work like that?
if it doesnt work, then can you tell me what will work? it has to bring me to a property using a string. thanks
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Mar 2015 03:23 PM
"game.Workspace.Part:FindFirstChild("Name")"

that would get the part's child named "Name"
you wouldn't get the part's name property
Report Abuse
SADSPenguin is not online. SADSPenguin
Joined: 23 Jul 2014
Total Posts: 21
25 Mar 2015 03:24 PM
yeah thats what i thought. i just wanted i ask before i made an entire function using that
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
25 Mar 2015 03:26 PM
if you want to wait for the character property of a player object for example, i think you could do this:

repeat wait() until player.Character

???
Report Abuse
blooo127127 is not online. blooo127127
Joined: 22 Jul 2010
Total Posts: 403
25 Mar 2015 03:37 PM
You cannot find properties with :FindFirstChild(). FindFirstChild looks for a child with the name that is the same as the string you provide, making it impossible to find anything other than that. Hence, properties cannot be found with it.
Report Abuse
SADSPenguin is not online. SADSPenguin
Joined: 23 Jul 2014
Total Posts: 21
25 Mar 2015 03:42 PM
i guess it will be easier to explain if i give you what im trying to do.

i have a textbox, which when typed in, changes the value of a vector3 value to the text. the vector3 value is called "angularvelocity". when i press a button, it inserts an BodyAngularVelocity to a part with the property angularvelocity set to whatever value was typed in. i did that with multiple properties, which i grouped together in a folder called Properties i am also trying to make this reusable for multiple instances such as BodyThrust.

to do this, i tried:

local selectedinstance = blahblahblah.SelectedInstance -- the type of instance i want to insert
local selectedpart = blahblahblah.SelectedPart
local properties = blahblahblah.SelectedInstance.Properties
local propertieslist = properties:GetChildren()

function blahblahblah()
local newinstance = instance.new(tostring(selectedinstance), selectedpart)

-- important stuff
for i,v in ipairs(propertieslist) do
wait()
newinstance:FindFirstChild(tostring(v)) = v.Value
end
-- end of important stuff

ignore all the syntax errors because i didnt copy the exact code, but basically thats what i tried to do. if you have any suggestions of how to do this, then i will be grateful.



Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
25 Mar 2015 03:55 PM
newinstance[v.Name] = v.Value
Report Abuse
SADSPenguin is not online. SADSPenguin
Joined: 23 Jul 2014
Total Posts: 21
25 Mar 2015 03:56 PM
thank you so much
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