Eggnivia
|
  |
| Joined: 30 May 2009 |
| Total Posts: 4144 |
|
|
| 24 Jan 2014 10:09 PM |
Key = e
string = sp.Keys.Key
If this is done, what will the variations be? eg. if I have a frame called Key, will string look for that? Or will it look for the frame called e?
And if this can't be done, are there other methods to allowing a string to use another string as a tree directory? |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2014 10:11 PM |
| string = sp.Keys:findFirstChild(Key) |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2014 10:11 PM |
It'll look for the string called Key, this is to look for e:
string = sp.Keys[key] --now it looks for e
I LOVE THY NAME BTW, Anivia is so amazing. :B |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 24 Jan 2014 10:12 PM |
I get it
It'll simply look for the object/Property "Key" in an object named "Keys" in a variable you defined as sp
It will never look for an object/property named "e" in "Keys" |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2014 10:12 PM |
string = sp.Keys:findFirstChild(Key) No, it'll look for an object called 'e' because Key was previosuly defined as "e" |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2014 10:13 PM |
It's string = sp.Keys:findFirstChild(Key) not string = sp.Keys:findFirstChild("Key") |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 24 Jan 2014 10:14 PM |
Actually you guys do realize even if he uses [Key] or :FindFirstChild(Key) it still wont work right? unless e is a string value.
And my 1st comment was directed at OP. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2014 10:16 PM |
| Well, yeah, but he was trying to understand an idea, I guess he might have forgotten about the quotes, I personally didn't notice and tried to answer what I think he meant. But you are right Wazap. OP name is still epic though. |
|
|
| Report Abuse |
|
|
Eggnivia
|
  |
| Joined: 30 May 2009 |
| Total Posts: 4144 |
|
|
| 24 Jan 2014 11:05 PM |
I have another question.
key = e If I run stats.spells[key], am I able to look for children under key (e)? And if so, how would I write that? Would it be stats.spells[key]status.Value if I wanted to look for the value of status in e? |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
|
| 24 Jan 2014 11:11 PM |
It would be
stats.spells[key].status.Value, but yes, like wazap said, if e is a string it'll work. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 24 Jan 2014 11:13 PM |
| Shouldve given a more specific answer XD ty @electric |
|
|
| Report Abuse |
|
|