|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 25 Mar 2015 03:55 PM |
| newinstance[v.Name] = v.Value |
|
|
| Report Abuse |
|
|
| |
|