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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: help with a script

Previous Thread :: Next Thread 
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
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 is not online. 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
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
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 is not online. 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
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
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
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
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
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
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
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
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
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
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
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
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
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
02 Aug 2011 05:13 PM
nevermind
Report Abuse
callofrobloxiamw3 is not online. callofrobloxiamw3
Joined: 28 May 2011
Total Posts: 488
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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