Light/color tweening

So i’m trying to have a light in my script go from Really Red to Lime Green, the issue is that it’s not working even with Color3, Vector3 and BrickColor, I didn’t find any solutions anywhere.

local tweenService = game:GetService("TweenService")
local light = script.Parent:WaitForChild("Light")

local tweenInfor = TweenInfo.new(.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)

local lightopen = {Color3 = Color3.new(0, 1, 0)}
local lightclose = {Color3 = Color3.new(1, 0, 0)}
local lightTween1 = tweenService:Create(light,tweenInfor,lightopen)
local lightTween2 = tweenService:Create(light,tweenInfor,lightclose)

script.Parent.Detector1.Touched:Connect(function(hit)
	lightTween1:Play()
	wait(2)
	lightTween2:Play()
	end)
script.Parent.Detector2.Touched:Connect(function(hit)
	lightTween1:Play()	
	wait(2)
	lightTween2:Play()	
end)

It’s Color, not Color3, for BaseParts. So you need to change it to this:

local lightopen = {Color = Color3.new(0, 1, 0)}
local lightclose = {Color = Color3.new(1, 0, 0)}
2 Likes

oh my god how did i not realize this, thanks you so much!

1 Like