insanehog
|
  |
| Joined: 08 Jul 2012 |
| Total Posts: 183 |
|
|
| 05 Dec 2014 06:33 PM |
I have a StringValue which has a name of an object. So when I need to access a directory with whatever object's name is in the StringValue, how would I do that?
so example:
workspace.StringValue.script:remove()
"StringValue" is what is inside of StringValue. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:35 PM |
workspace:findFirstChild(stringvalue.Value)?
also, you could just use an objectvalue instance instead |
|
|
| Report Abuse |
|
|
insanehog
|
  |
| Joined: 08 Jul 2012 |
| Total Posts: 183 |
|
|
| 05 Dec 2014 06:38 PM |
Well wait no. In my script, whatever object's name is inside of String.Value, I want to use that when going through a directory.
For example:
3 objects:
car bed floor
String.Value = "car"
workspace.[String.Value].wheel ^
how would I do that |
|
|
| Report Abuse |
|
|
Qivr
|
  |
| Joined: 22 Aug 2014 |
| Total Posts: 5407 |
|
|
| 05 Dec 2014 06:39 PM |
you need to express what you're trying to do better maybe local a = game.Workspace:findFirstChild(String.Value)
[Qivr] Hail Greenland! |
|
|
| Report Abuse |
|
|
insanehog
|
  |
| Joined: 08 Jul 2012 |
| Total Posts: 183 |
|
|
| 05 Dec 2014 06:42 PM |
Sorry, it's just difficult to explain. But what you gave me works, but I remember doing it in just one line.
something like this:
game.Workspace[String.Value].Wheel |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:44 PM |
o ik what ur asking... ye i dont code that way so... im no help |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 07:02 PM |
--stringValue = the value you are referring to --product = "stringValue's" Value
local stringValue = workspace.Value local product = stringValue.Value print(unpack(workspace[product]:children()))
|
|
|
| Report Abuse |
|
|