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)