-- Find the device's rotation via gyroscope and apply to the segway

	UserInputService.DeviceRotationChanged:connect(function(rotation, rotCFrame)
	local x,y = rotCFrame:toEulerAnglesXYZ()
	local Sensitivity = 1.9
	
		-- Direction
		if -x*Sensitivity > -1 and -x*Sensitivity < 1 then -- Makes sure the device isn't tilted too much
			Direction = -x*Sensitivity+0.4
		elseif -x*Sensitivity > 0 then -- Otherwise we'll go to the max speed
			Direction = 1
		elseif -x*Sensitivity < 0 then -- Otherwise we'll go to the max speed
			Direction = -1
		end
			
		-- Steering
		if -y*Sensitivity > -1 and -y*Sensitivity < 1 then -- Makes sure the device isn't tilted too much
			Steer = -y*Sensitivity
		elseif -y*Sensitivity > 0 then -- Otherwise we'll go to the max speed
			Steer = 1
		elseif -y*Sensitivity < 0 then -- Otherwise we'll go to the max speed
			Steer = -1
		end
	end)
end
