Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Module script GetChildren?

Asked by
Codebot 85
8 years ago

So what I'm trying to do is find all the parts inside the model Grass named wall. module.position is my "Players position" which starts, as you can see, at (0,0,0) I'd like to print the wall's module position. So lets say 4 movements up is (0,0,4), it prints (0,0,4).

Inside my module script (I also have more code that works in here. This are just what I need help with)

module.position = Vector3.new(0,0,0)
module.parts = game.Workspace.Grass:GetChildren()

Inside my LocalScript

for i = 1,#module.parts do
            local wall = module.parts[i]
            if wall.Name == "wall" then
                print(wall.Name) -- Prints all the parts named wall, It works c:
                wall.pos = Vector3.new() -- Where I need help defining
            end
        end

Thank you! c:

Answer this question