06-18-2011, 01:10 AM
So if a tool had a fly script in it, I'd be the child and the tool would be the parent? :O
I am learning to script and I have a question..
|
06-18-2011, 01:10 AM
So if a tool had a fly script in it, I'd be the child and the tool would be the parent? :O
06-18-2011, 01:10 AM
This should be in the scripter's section.
06-18-2011, 01:13 AM
Let's say you have a script inside of a box.
Box VV Script The scripts parent is the box. the Box's child is the script.
06-18-2011, 01:29 AM
To find a child inside a parent, you can either go
[lua] box.[[childsname]] [/lua] or, and you have to do this if there's a space in the name, [lua] box:getChild("[[childsname]]") --or in ROBLOX box:findFirstChild("[[childsname]]") [/lua][/lua]
06-18-2011, 01:37 AM
Can't you also do,
[lua] box["childsname"] [/lua] Sorry it's been a while since I've scripted in Lua.
06-18-2011, 01:42 AM
I think so, but I've almost never seen it used.
06-18-2011, 03:28 PM
You can't do box.[["childname"]] it's box["childname"].Whatever
06-18-2011, 03:53 PM
(06-18-2011, 01:37 AM)noob007 Wrote: Can't you also do, The advantage of doing it that way is that you can use variables. box.variableName will give you the child named variableName, but box[variableName] (no quotes) will give you the child with the name that is stored in the variable. |
« Next Oldest | Next Newest »
|