script.Parent.OnServerEvent:connect(function(T,x)if lt~=1 then pr=true else pr=false end lt=x if lt==0 or lt==1 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~=0 and lt~=1 elseif lt==2 then UpdateLt(.25,white)UpdatePt(true,white)UpdateMt(0,9000000000.0,1)repeat if math.deg(RefMt.CurrentAngle%math.rad(360))>=90 then UpdateLt(.25,white)end if math.deg(RefMt.CurrentAngle%math.rad(360))>=90 then UpdatePt(true,white)end if math.deg(RefMt.CurrentAngle%math.rad(360))>=270 then UpdateLt(.25,red)end if math.deg(RefMt.CurrentAngle%math.rad(360))>=270 then UpdatePt(true,red)end wait()until lt~=2 elseif lt==3 then UpdateLt(.25,red)UpdatePt(true,red)UpdateMt(0,9000000000.0,1)repeat 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 == 0 or lt == 1) 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~=0 and lt~=1)
	elseif lt == 2 then
		UpdateLt(.25,white)
		UpdatePt(true,white)
		UpdateMt(0,9e9,1)
		repeat
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdateLt(.25,white) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdatePt(true,white) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdateLt(.25,red) end
			if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdatePt(true,red) end
			wait()
		until lt~=2
	elseif lt == 3 then
		UpdateLt(.25,red)
		UpdatePt(true,red)
		UpdateMt(0,9e9,1)
		repeat wait() until lt~=3
	end
end)
