Coloring tween flashing green

I have this script that changes some parts of a model to yellow, but it keeps flashing green while doing so then after 10 seconds changes to black.

Here is the script

TweenService=game:GetService("TweenService")

Laser=workspace.LaserBeam
Glass=workspace.Frontglass
Forcefield=workspace.Frontforcefield

laserBeam=Laser.LaserBeam
button=Laser.Button
click=button.ClickDetector
laser=laserBeam.Laser
shell=laserBeam.Union
inside=laserBeam.Inside
laserLights=laser:GetChildren()
rings=laserBeam.Rings

colorInfo=TweenInfo.new(10)

neon=Enum.Material.Neon

yellowShell=TweenService:Create(shell,colorInfo,{Color=Color3.new(255,255,0)})

lightBrightness=200

function toggle(ring,mode)
	if mode==true then
		local tween=TweenService:Create(ring,colorInfo,{Color=Color3.new(255,255,0)})
		tween:Play()
		wait(5)
		ring.Material=neon
	end
end
function thing()
	click.MaxActivationDistance=0
	button.Color=Color3.new(1)
	yellowShell:Play()
	for ring=1,#rings:GetChildren() do
		spawn(function()toggle(rings["Ring"..ring],true)end)
	end
	wait(5)
	shell.Material=neon
end
click.MouseClick:Connect(function(player)
	
end)

game.ServerStorage.Events.Event.Event:Connect(thing)
1 Like

Each of these needs to be Color3.fromRGB

1 Like

Adding on, Color3.new() only takes numbers from 0 to 1, whilst Color3.fromRGB() takes numbers from 0 to 255.

1 Like

When I used .new() I selected the color through the small button that come below the cursor when inside the parameters. When selecting the color I wanted in the color panel, it auto filled it to 255, 255,0. Wouldn’t it autofill 1,1,0 instead then?

You must’ve have done something wrong then, because I just tried and it did it correctly.
image

You’re right, sorry for the confusion : D

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.