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
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:
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
not too familiar with lua c but that probably equals "Players.GetChildren.Character ..." don't you have to actually call the getchildren function?