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

GetChildren help to reach a destination?

Asked by 10 years ago

Hello, thanks for reading.

Error: 17:27:14.449 - Workspace.Meltdown Detector:63: 'end' expected (to close 'function' at line 6) near '<eof>'

I am having trouble with GetChildren while getting to the destination.

So, this is part of my script

        local mainframelights = workspace.MainframeLights:GetChildren()
        for i = 1, #mainframelights do
        mainframelights.Light.PointLight[i].Color = Color3.new(255, 0, 0)
end

And this is my module workspace:

Workspace
    MainframeLights (Module)
        Light (Module)
            Light (Part)
                PointLight (PointLight)
        Light (Module)
            Light (Part)
                PointLight (PointLight)
        Light (Module)
            Light (Part)
                PointLight (PointLight)
        Light (Module)
            Light (Part)
                PointLight (PointLight)
        Light (Module)
            Light (Part)
                PointLight (PointLight)
        Light (Module)
            Light (Part)
                PointLight (PointLight)

Thanks if you helped! :)

1 answer

Log in to vote
1
Answered by
SirNoobly 165
10 years ago

Indent your code to find the missing end. Also for:

mainframelights.Light.PointLight[i].Color = Color3.new(255, 0, 0)

Get rid of the [i] it just breaks it.

Switch Color3.new(255, 0, 0) to Color3.new(1, 0, 0) as Color3 is 0-1. (divide by 255 if you want a specific colour)

0
Thanks :) WelpNathan 307 — 10y
Ad

Answer this question