I'm making a light that fades out, then back in a blinking pattern using TweenService. It fades out, but it won't fade back in. How do I fix this?
TweenService = game:GetService("TweenService") info = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0) local changeVal = .8; local changeVal2 = 12; Light = TweenService:Create(script.Parent.SpotLight, info, {Brightness = changeVal}) Light:Play() Light.Completed:End() Light2 = TweenService:Create(script.Parent.SpotLight, info, {Brightness = changeVal2}) Light2:Play() Light2.Completed:End()
There is no such thing as Light.Completed:End(). Replace it with Light.Completed:Wait()
I've figured it out, just a quick adjustment.
TweenService = game:GetService("TweenService") info = TweenInfo.new(2,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0) local changeVal = .8; local changeVal2 = 12; Light = TweenService:Create(script.Parent.SpotLight, info, {Brightness = changeVal}) Light2 = TweenService:Create(script.Parent.SpotLight, info, {Brightness = changeVal2}) Light:Play() Light.Completed:Connect(function()Light2:Play() end)