I am trying to make it so that the parts, PointLights, and BillboardGuis fade in and out in my police car, but with this script, it only works with one part, and the rest of the parts do not work. Anyone who can help me fix this?
local grp1 = script.Parent.Lights
local TweenService = game:GetService("TweenService")
while true do
for i,v in pairs(grp1:GetDescendants()) do
if v:IsA("BasePart") then
parton = TweenService:Create(v, TweenInfo.new(1), {Transparency = 0})
partoff = TweenService:Create(v, TweenInfo.new(1), {Transparency = 1})
end
if v:IsA("ImageLabel") then
guion = TweenService:Create(v, TweenInfo.new(1), {ImageTransparency = 0})
guioff = TweenService:Create(v, TweenInfo.new(1), {ImageTransparency = 1})
end
if v:IsA("PointLight") then
lighton = TweenService:Create(v, TweenInfo.new(1), {Brightness = 0})
lightoff = TweenService:Create(v, TweenInfo.new(1), {Brightness = 1})
end
end
if script.Parent.on.Value == 1 then
parton:Play()
guion:Play()
lighton:Play()
wait(1)
partoff:Play()
guioff:Play()
lightoff:Play()
elseif script.Parent.on.Value == 0 then
partoff:Play()
guioff:Play()
lightoff:Play()
end
wait(0.05)
end
