script.Parent.OnServerEvent:connect(function(h,o)if lt~=1 then pr=true else pr=false end lt=o if lt~=3 then RefMt.DesiredAngle=RefMt.CurrentAngle%math.rad(360)RefMt.CurrentAngle=RefMt.CurrentAngle%math.rad(360)UpdateLt(1,white)UpdatePt(false,white)StopMt(pr)repeat wait()until lt==3 elseif lt==3 then wait(.33333333333333)UpdateLt(.25,red)UpdatePt(true,red)UpdateMt(0,9000000000.0,1)repeat if math.deg(RefMt.CurrentAngle%math.rad(360))>=90 then UpdateLt(.25,amber)end if math.deg(RefMt.CurrentAngle%math.rad(360))>=90 then UpdatePt(true,amber)end if math.deg(RefMt.CurrentAngle%math.rad(360))>=270 then UpdateLt(.25,white)end if math.deg(RefMt.CurrentAngle%math.rad(360))>=270 then UpdatePt(true,white)end wait()until lt~=3 end end)


script.Parent.OnServerEvent:connect(function(pl,n) if lt~=1 then pr = true else pr=false end lt=n
	if lt~=3 then
		RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360)
		RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360)
		UpdateLt(1,white)
		UpdatePt(false,white)
		StopMt(pr)
		repeat wait() until (lt==3)
	elseif lt == 3 then
		wait(1/3)
		UpdateLt(.25,red)
		UpdatePt(true,red)
		UpdateMt(0,9e9,1)
		repeat 
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdateLt(.25,amber) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdatePt(true,amber) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdateLt(.25,white) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdatePt(true,white) end
			wait()
		until lt~=3
	end
end)
