---////==========================================\\\---	
--To install the fans, group them together with the switch. You can have multiple fans installed and be controlled by one switch! Just make sure all fans and the switch have the same parent!-- (In other words, if you know how to install SmartLites, then you do the same here)--
---////==========================================\\\---	

Switch = script.Parent.Parent.Parent.Switch.IsOn
Motor = script.Parent.Motor
Shutter = script.Parent.Parent.Housing

function Active()
	if Switch.Value == true then
		Shutter.OpenShutter.Transparency = 0
		Shutter.ClosedShutter.Transparency = 1
		Motor.Sound:Play()
		Motor.Sound.PlaybackSpeed = 0
			while true do
			Motor.BottomParamB = Motor.BottomParamB + 0.01
			Motor.Sound.PlaybackSpeed =  Motor.BottomParamB
			wait()
			if  Motor.BottomParamB >= 1 then break end
			if Switch.Value == false then break end
			
			end
	elseif Switch.Value == false then
			while true do
			script.Parent.Motor.BottomParamB = Motor.BottomParamB - 0.005
			Motor.Sound.PlaybackSpeed =  Motor.BottomParamB
			wait()
			if Switch.Value == true then break end
			if Motor.BottomParamB <= 0 then break end
			end
			Motor.BottomParamB = 0
		Shutter.OpenShutter.Transparency = 1
		Shutter.ClosedShutter.Transparency = 0
	end
	end
Switch.Changed:connect(Active)
