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

How can I make all the parts in a group glow at night? [solved]

Asked by 6 years ago
Edited 6 years ago

I tried doing this:

lightPart = game.Workspace.lights:GetChildren()
minutesAfterMidnight = 0

while true do
    if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then  
    lightPart.Material = Enum.Material.Plastic

end
if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then 
    lightPart.Material = Enum.Material.Neon
    end
wait(0.1)
end

But it didn't work. Help?

1 answer

Log in to vote
0
Answered by 6 years ago

lightPart is a table. If you want to get all the parts in the table, you must use a for loop.

It’d be something like this :

for i,part in pairs(lightPart) do
part.Material = Enum.Material.Plastic
end
0
thank you i figured it out :) radusavin366 617 — 6y
0
Lighting Charactors? Zikelah 20 — 5y
Ad

Answer this question