|
| 02 Aug 2011 04:56 PM |
local children = game.Workspace.Model:GetChildren() for i = 1, #children do game.StarterGui.ScreenGui.Frame.i.Text = ""..children[i] end
I know the error and everything I jsut dont know how to fix it heres the output although i know its a problem with the i i want it to be whatever the i =
output: i is not a valid member of Frame
|
|
|
| Report Abuse |
|
|
Boomarang
|
  |
| Joined: 15 Jul 2008 |
| Total Posts: 919 |
|
|
| 02 Aug 2011 05:01 PM |
:GetChildren() gives you a read-only table of object names to let you know.
local chi = game.Workspace.Model:GetChildren() for _, v in ipairs(chi) do game.StarterGui.ScreenGui.Frame.i.Text = v.Name end |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:02 PM |
local children = game.Workspace.Model:GetChildren() for i = 1, #children do game.StarterGui.ScreenGui.Frame.Text = children[i].Name end
You had an i inbetween Frame and Text. |
|
|
| Report Abuse |
|
|
Boomarang
|
  |
| Joined: 15 Jul 2008 |
| Total Posts: 919 |
|
|
| 02 Aug 2011 05:02 PM |
| Wait, i can't be the name of what you are trying to descend to. It will error, thinking you are trying to call a variable in the parent. Or, i isn't the name of anything in there. :P |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:04 PM |
| the i was supposed to be there the i is what i need fixing i want it show it finds the name of whatever number i is currently |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:05 PM |
Ooh.
game.StarterGui.ScreenGui.Frame[i].Text = children[i].Name, then... I don't really get what you want to achieve, though. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:06 PM |
| inside the frame theres 3 text labels named 1,2,3 the i is supposed to be the 3 parts inside of the Model so that each of those 3 text labels will have the text of whatever the 3 parts are and also btw for the first two posts there is no text in frame incase you didnt notice |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:07 PM |
No, wait. Nevermind my last reply. Now I'm competely confused.
What do you want this script to do? Why did you have 'Frame.i.Text'? -- If you meant Frame[i], Frame[i] would be the same as any number between 1 and #children (unknown), such as Frame2.
|
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:10 PM |
okay the model in workspace has 3 parts all named diffrently the startergui has a screengui with a frame inside of it and inside that frame are 3 text labels named 1,2,3 so its supposed to do is find the first one named i the first time going through when i = 1 then 2nd time find i = 2 |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2011 05:13 PM |
| Mind naming the textlabels t1, t2, t3 instead? The script doesn't tolerate pure numbers as names |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Aug 2011 05:14 PM |
i fixed it myself it was this: local children = game.Workspace.Model:GetChildren() for i = 1, #children do game.StarterGui.ScreenGui.Frame["a"..i].Text = children[i].Name end |
|
|
| Report Abuse |
|
|