I was wondering if there was a getchildren function in Lua C
getglobal game getfield -1 Players getfield -1 GetChildren getfield -1 Character getfield -1 Humanoid pushnumber 100 setfield -2 Walkspeed
In short: Yes, there is.
In slightly Longer: GetChildren()
does exist in Lua C, and is used very often. For example, this script below will print all the Children of the Workspace
. (it will not show any descendants of the children, though. Keep reading to find out how to do that.)
local children = workspace:GetChildren for i, v in pairs(children) do print(v) end
Pretty simple, right? Now, there's also another one, called GetDescendants()
. This returns all descendants of the object it's called on, including things like the descendants of all descendants. It's kinda hard to explain to be honest. Here are some links if you need some more info on these: